+ Reply to Thread
Results 1 to 4 of 4

VB Code to add Sheets

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code to add Sheets

    Hello:

    Please refer to attached file.
    I am trying add sheets by adding below code but its giving error.
    Pls help correct code

    Please Login or Register  to view this content.

    Let me know if you have any questions.
    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: VB Code to add Sheets

    If you add a sheet, it WILL BE the Active Sheet ... and it will be empty. So, trying to name a sheet based on a (empty) cell on that Active Sheet will error out. You will need to explicitly refer to the sheet where the cell with the sheet name exists.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to add Sheets

    Hello TMS:

    Thanks a lot
    i got it.

    Riz

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: VB Code to add Sheets

    You're welcome. Thanks for the rep.

+ 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. Replies: 19
    Last Post: 05-31-2018, 08:09 AM
  2. [SOLVED] Want to apply code to all sheets available in workbook except two sheets with fast working
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-28-2017, 08:55 AM
  3. [SOLVED] VBA code adds sheets from other files to a master WB, but the sheets are in reverse order
    By Royzer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-18-2016, 03:53 PM
  4. Programming code : Sheets.Add After:=Sheets(Sheets.Count)
    By Blok , Robert in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-17-2015, 05:00 AM
  5. Replies: 6
    Last Post: 03-29-2006, 07:50 AM
  6. [SOLVED] How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook?
    By Dmitry in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-29-2006, 07:50 AM
  7. Replies: 6
    Last Post: 03-29-2006, 07:50 AM

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