+ Reply to Thread
Results 1 to 19 of 19

Add and rename sheets using vba

  1. #1
    Registered User
    Join Date
    05-02-2019
    Location
    Tamilnadu, India
    MS-Off Ver
    2010
    Posts
    14

    Add and rename sheets using vba

    Query needed for add multiple sheets and rename them using VBA.

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,715

    Re: Add and rename sheets using vba

    this is very easy but a bit more information might make the response more useful eg how many sheets and what names.
    This may get you started - it will add 6 sheets named MySheet1 to MySheet6 at the end of the active workbook

    Please Login or Register  to view this content.
    Last edited by NickyC; 05-03-2019 at 03:52 AM.

  3. #3
    Registered User
    Join Date
    05-02-2019
    Location
    Tamilnadu, India
    MS-Off Ver
    2010
    Posts
    14

    Re: Add and rename sheets using vba

    in the above query is useful but im in the need of rename the sheet name by existing values. Kindly give some query on the same

  4. #4
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,715

    Re: Add and rename sheets using vba

    Hi
    sorry, I'm not sure what you mean by "rename the sheet name by existing values".
    Are the sheet names stored in a range in the workbook? Or are the new sheets' names based on existing sheets' names?

  5. #5
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,715

    Re: Add and rename sheets using vba

    Hi Swann
    i'm shortly logging off for the day but will try to visit this site tomorrow.
    A variation that may be more useful is this: it creates new sheets and gives them the names in cells A1:A6 of the first sheet in the workbook.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    05-02-2019
    Location
    Tamilnadu, India
    MS-Off Ver
    2010
    Posts
    14

    Re: Add and rename sheets using vba

    Nicky,

    Check and mentioned if you found any errors.

    Please Login or Register  to view this content.
    Last edited by AliGW; 05-06-2019 at 01:08 AM.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,862

    Re: Add and rename sheets using vba

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new here, I have done it for you this time.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  8. #8
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,715

    Re: Add and rename sheets using vba

    Hi Swann
    sorry I am still not clear exactly what it is you are trying to do
    your macro will rename sheets 1 to 5 as eg "base info" but the for ... next loop doesn't do anything, nor does your array. Are you hoping to add sheets new sheets with the names in your array? If so, try something like this:

    Please Login or Register  to view this content.

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Add and rename sheets using vba

    Quote Originally Posted by Swann View Post
    Please Login or Register  to view this content.
    Perhaps
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    05-02-2019
    Location
    Tamilnadu, India
    MS-Off Ver
    2010
    Posts
    14

    Re: Add and rename sheets using vba

    Team,

    After completing these sheets in workbook, have to give some inputs to every sheet.

    Eg: In Base info sheet - name, address, ph no like that…

    Give some ideas to create that.

  11. #11
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,347

    Re: Add and rename sheets using vba

    I think you should upload a file with the data you will enter and the result you want.

    To attach a file, under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.
    If you want something done right... find a forum and ask an online expert.

    Time flies like an arrow. Fruit flies like a banana.

  12. #12
    Registered User
    Join Date
    05-02-2019
    Location
    Tamilnadu, India
    MS-Off Ver
    2010
    Posts
    14

    Re: Add and rename sheets using vba

    Find attached the input and output result for your reference. Kindly give the solution
    Attached Files Attached Files

  13. #13
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Add and rename sheets using vba

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

  14. #14
    Registered User
    Join Date
    05-02-2019
    Location
    Tamilnadu, India
    MS-Off Ver
    2010
    Posts
    14

    Re: Add and rename sheets using vba

    it could't understand can you please explain this?

  15. #15
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Add and rename sheets using vba

    Explain what?

    It is doing what you requested from your 2 files provided.

  16. #16
    Registered User
    Join Date
    05-02-2019
    Location
    Tamilnadu, India
    MS-Off Ver
    2010
    Posts
    14

    Re: Add and rename sheets using vba

    In that, can i declare my sheet names and their respected values in the coding itself?

    if i declare in coding page it easier for understanding because am a newbie cant understand your code that's the reason i ask.

  17. #17
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Add and rename sheets using vba

    What do you really want to do?

    By the way, do your country have some word to express appreciation when you received some help?

  18. #18
    Registered User
    Join Date
    05-02-2019
    Location
    Tamilnadu, India
    MS-Off Ver
    2010
    Posts
    14

    Re: Add and rename sheets using vba

    Forgot to say, thank you so much for your help....

  19. #19
    Registered User
    Join Date
    05-02-2019
    Location
    Tamilnadu, India
    MS-Off Ver
    2010
    Posts
    14

    Re: Add and rename sheets using vba

    Please Login or Register  to view this content.
    Can you please explain this above statement?

+ 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] Loop worksheets and if sheets Name matches pattern, rename sheets
    By dluhut in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-23-2016, 01:08 AM
  2. Rename sheets
    By TonyBraxton in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-31-2015, 06:08 PM
  3. [SOLVED] Add and rename sheets
    By Gunilla in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-21-2012, 12:55 PM
  4. Code to delete sheets and rename sheets in a protected workbook?
    By leaning in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-07-2011, 03:02 AM
  5. Add Sheets and rename
    By GregR in forum Excel General
    Replies: 13
    Last Post: 02-13-2005, 07:06 PM
  6. Rename sheets
    By cottage6 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-03-2005, 08:06 PM
  7. Rename Sheets
    By Kevin R in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-03-2005, 03:06 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