+ Reply to Thread
Results 1 to 6 of 6

VBA to insert new sheet

  1. #1
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    VBA to insert new sheet

    The code below runs fine except when I insert the sheet_name_to_create line towards the bottom. Something seems to be wrong with the syntax, but I can not figure it out. Basically, I am trying to create one button that will classify and after that insert a new worksheet.Thanks.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,650

    Re: VBA to insert new sheet

    if in A2 is a valid name for sheet then after adding new sheet
    Please Login or Register  to view this content.
    shall work fine
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    Re: VBA to insert new sheet

    So is that

    Please Login or Register  to view this content.
    Thanks.

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,650

    Re: VBA to insert new sheet

    No this will be interpreted that way that first
    Please Login or Register  to view this content.
    is evalueated and then
    ActiveSheet.Name will be assigned result of the above (false or true).


    I ment:
    Please Login or Register  to view this content.
    but again, frankly: double check if A2 is proper sheetname.

  5. #5
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    Re: VBA to insert new sheet

    sheets_name_to_create is highlighted and variable not defined. Thanks.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,650

    Re: VBA to insert new sheet

    So ... define these names.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA codes to insert the rows and copy the first entire row text and insert sheet
    By PRADEEPB270 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-26-2013, 05:05 AM
  2. Replies: 1
    Last Post: 11-20-2012, 10:01 PM
  3. Replies: 1
    Last Post: 10-22-2012, 03:26 AM
  4. Copy Sheet / Create & Name New Sheet / Insert Before a Sheet / Paste Data
    By thinkspac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2012, 02:27 PM
  5. Populate summary sheet (insert & index rows from info in columns on another sheet)
    By DerbysGal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2011, 01:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1