{"id":12070,"date":"2011-10-11T11:16:59","date_gmt":"2011-10-11T11:16:59","guid":{"rendered":"http:\/\/www.learnexcelmacro.com\/?p=46"},"modified":"2011-10-11T11:16:59","modified_gmt":"2011-10-11T11:16:59","slug":"add-a-sheet-using-excel-macro","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/","title":{"rendered":"Add a Sheet using Excel Macros"},"content":{"rendered":"

Adding a sheet in Already existing workbook is very easy. It can be done manually easily. Here we are going to learn, how to add a Sheet in an already existing workbook using Excel Macro. For doing so, there can be many possibilities.
\n 
\nFor example:\u00a0 <\/strong> we might want to add a new sheet always with certain format. In this case, either we first add a new Sheet to the workbook without any formatting and then do the same formatting using macro, or make a Template (Sheet) which has exactly the same format what you want in each sheet and then copy the same Template each time and then rename the sheet name with the given name.<\/p>\n

In some cases, you might just want to add a new sheet (without any formatting) with a name given by user. In this case you can just add a new sheet using macro and then rename the sheet name with the given name by user.
\n 
\nNote: <\/strong><\/span> While adding a new Sheet in Excel, MS Excel never ask for a name of that new Sheet; It always gives it’s own generated name like Sheet 1, Sheet 2, Sheet 3….etc. So when you want to add a New sheet with your own Name, First add a Sheet and then Rename it with your given Name. This is the reason, you can see in both the below example we are first adding a new Sheet and then renaming it.<\/em>
\n <\/p>\n

i) When you have already built template for the sheet: <\/h2>\n
\r\nSub addsheet(VariableSheetName)\r\n' *****************************************************\r\n' Before adding any sheet in to workbook we need\r\n' to make sure that there is no sheet already there\r\n' in the work book with same name.\r\n' *****************************************************\r\nDim SheetExists as Boolean\r\nSheetExists = False\r\nFor Each Sheet In Sheets\r\nIf Ucase(Sheet.Name ) = Ucase(VariableSheetName) Then\r\nSheetExists = True\r\nMsgbox(\"This Sheet already exists\")\r\nEnd If\r\nNext Sheet\r\nIf (SheetExists = False) Then\r\nWorksheets(\"Expences-Template\").Copy After:=Worksheets(\"Expences-Template\")\r\nWorksheets(\"Expences-Template (2)\").Name = VariableSheetName\r\nEnd If\r\nWorksheets(VariableSheetName).Activate\r\nEnd Sub\r\n<\/code><\/pre>\n

 <\/p>\n

ii) When you have to simply add a sheet with desired name<\/h2>\n
\r\nSub AddSheet(VariableSheetName)\r\n' *****************************************************\r\n' Before adding any sheet in to workbook we need\r\n' to make sure that there is no sheet already there\r\n' in the work book with same name.\r\n' *****************************************************\r\nDim SheetExists as Boolean\r\nSheetExists = False\r\nFor Each Sheet In Sheets\r\nIf Ucase(Sheet.Name ) = Ucase(VariableSheetName) Then\r\nSheetExists = True\r\nMsgBox(\"This Sheet already exists\")\r\nEnd If\r\nNext Sheet\r\nIf (SheetExists = False) Then\r\nWorksheets.Add().Name = VariableSheetName\r\nWorksheets(VariableSheetName).Select\r\nEnd Sub\r\n<\/code><\/pre>\n<\/span>","protected":false},"excerpt":{"rendered":"

Adding a sheet in Already existing workbook is very easy. It can be done manually easily. Here we are going to learn, how to add a Sheet in an already existing workbook using Excel Macro. For doing so, there can be many possibilities.   For example:\u00a0 we might want to add a new sheet always […]<\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[1246,1674],"tags":[],"class_list":["post-12070","post","type-post","status-publish","format-standard","hentry","category-macro","category-excel-macro-basics"],"yoast_head":"\nAdding a Sheet to Excel using Excel Macros - Easy way to Add Sheet using VBA<\/title>\n<meta name=\"description\" content=\"Macro to Add\/Create a New Sheet in Workbook | Add a New sheet with a given Name by User using Macro | Always add a New Sheet having specific Format\/Template using macro\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Add a Sheet using Excel Macros\" \/>\n<meta property=\"og:description\" content=\"Macro to Add\/Create a New Sheet in Workbook | Add a New sheet with a given Name by User using Macro | Always add a New Sheet having specific Format\/Template using macro\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/\" \/>\n<meta property=\"og:site_name\" content=\"Let's excel in Excel\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/vmlogger\" \/>\n<meta property=\"article:author\" content=\"http:\/\/www.facebook.com\/vmlogger\" \/>\n<meta property=\"article:published_time\" content=\"2011-10-11T11:16:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/vmlogger.com_-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Vishwamitra Mishra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/www.twitter.com\/learnexcelmacro\" \/>\n<meta name=\"twitter:site\" content=\"@learnexcelmacro\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vishwamitra Mishra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/\"},\"author\":{\"name\":\"Vishwamitra Mishra\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"headline\":\"Add a Sheet using Excel Macros\",\"datePublished\":\"2011-10-11T11:16:59+00:00\",\"dateModified\":\"2011-10-11T11:16:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/\"},\"wordCount\":273,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"articleSection\":[\"Excel Macro\",\"Excel Macro Basics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/\",\"name\":\"Adding a Sheet to Excel using Excel Macros - Easy way to Add Sheet using VBA\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\"},\"datePublished\":\"2011-10-11T11:16:59+00:00\",\"dateModified\":\"2011-10-11T11:16:59+00:00\",\"description\":\"Macro to Add\/Create a New Sheet in Workbook | Add a New sheet with a given Name by User using Macro | Always add a New Sheet having specific Format\/Template using macro\",\"breadcrumb\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/vmlogger.com\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Excel Macro\",\"item\":\"https:\/\/vmlogger.com\/excel\/macro\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Add a Sheet using Excel Macros\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\",\"url\":\"https:\/\/vmlogger.com\/excel\/\",\"name\":\"Let's excel in Excel\",\"description\":\"Let's share knowledge\",\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/vmlogger.com\/excel\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\",\"name\":\"Vishwamitra Mishra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png\",\"contentUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png\",\"width\":528,\"height\":560,\"caption\":\"Vishwamitra Mishra\"},\"logo\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/\"},\"description\":\"My name is Vishwamitra Mishra. Friends Call me Vishwa. I hold a Bachelor\u2019s Degree in Computer Science from D.A.V.V. Indore & currently working as a Technical Lead having over 7 years of experience.\",\"sameAs\":[\"http:\/\/www.learnexcelmacro.com\",\"http:\/\/www.facebook.com\/vmlogger\",\"https:\/\/x.com\/https:\/\/www.twitter.com\/learnexcelmacro\",\"https:\/\/www.youtube.com\/c\/VMLogger\"],\"url\":\"https:\/\/vmlogger.com\/excel\/author\/vishwamitra\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Adding a Sheet to Excel using Excel Macros - Easy way to Add Sheet using VBA","description":"Macro to Add\/Create a New Sheet in Workbook | Add a New sheet with a given Name by User using Macro | Always add a New Sheet having specific Format\/Template using macro","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/","og_locale":"en_US","og_type":"article","og_title":"Add a Sheet using Excel Macros","og_description":"Macro to Add\/Create a New Sheet in Workbook | Add a New sheet with a given Name by User using Macro | Always add a New Sheet having specific Format\/Template using macro","og_url":"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/","og_site_name":"Let's excel in Excel","article_publisher":"http:\/\/www.facebook.com\/vmlogger","article_author":"http:\/\/www.facebook.com\/vmlogger","article_published_time":"2011-10-11T11:16:59+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/vmlogger.com_-1.png","type":"image\/png"}],"author":"Vishwamitra Mishra","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/www.twitter.com\/learnexcelmacro","twitter_site":"@learnexcelmacro","twitter_misc":{"Written by":"Vishwamitra Mishra","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/#article","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/"},"author":{"name":"Vishwamitra Mishra","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"headline":"Add a Sheet using Excel Macros","datePublished":"2011-10-11T11:16:59+00:00","dateModified":"2011-10-11T11:16:59+00:00","mainEntityOfPage":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/"},"wordCount":273,"commentCount":1,"publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"articleSection":["Excel Macro","Excel Macro Basics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/","url":"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/","name":"Adding a Sheet to Excel using Excel Macros - Easy way to Add Sheet using VBA","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/#website"},"datePublished":"2011-10-11T11:16:59+00:00","dateModified":"2011-10-11T11:16:59+00:00","description":"Macro to Add\/Create a New Sheet in Workbook | Add a New sheet with a given Name by User using Macro | Always add a New Sheet having specific Format\/Template using macro","breadcrumb":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/vmlogger.com\/excel\/2011\/10\/add-a-sheet-using-excel-macro\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vmlogger.com\/excel\/"},{"@type":"ListItem","position":2,"name":"Excel Macro","item":"https:\/\/vmlogger.com\/excel\/macro\/"},{"@type":"ListItem","position":3,"name":"Add a Sheet using Excel Macros"}]},{"@type":"WebSite","@id":"https:\/\/vmlogger.com\/excel\/#website","url":"https:\/\/vmlogger.com\/excel\/","name":"Let's excel in Excel","description":"Let's share knowledge","publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vmlogger.com\/excel\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5","name":"Vishwamitra Mishra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/","url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png","contentUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png","width":528,"height":560,"caption":"Vishwamitra Mishra"},"logo":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/"},"description":"My name is Vishwamitra Mishra. Friends Call me Vishwa. I hold a Bachelor\u2019s Degree in Computer Science from D.A.V.V. Indore & currently working as a Technical Lead having over 7 years of experience.","sameAs":["http:\/\/www.learnexcelmacro.com","http:\/\/www.facebook.com\/vmlogger","https:\/\/x.com\/https:\/\/www.twitter.com\/learnexcelmacro","https:\/\/www.youtube.com\/c\/VMLogger"],"url":"https:\/\/vmlogger.com\/excel\/author\/vishwamitra\/"}]}},"_links":{"self":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/12070"}],"collection":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/comments?post=12070"}],"version-history":[{"count":0,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/12070\/revisions"}],"wp:attachment":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/media?parent=12070"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/categories?post=12070"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/tags?post=12070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}