+ Reply to Thread
Results 1 to 8 of 8

VBA code should ask for every sheet to rename

  1. #1
    Forum Contributor
    Join Date
    03-13-2013
    Location
    india
    MS-Off Ver
    excel 2010
    Posts
    427

    VBA code should ask for every sheet to rename

    in the attached file there is VBA code that code i use to raname sheets name but that code only rename one sheet at a time, then i should run again
    that macro to rename another sheet , i want that VBA ask for every sheet until whole sheet not renamed in this file there is four sheet
    so VBA should ask me four time to rename the sheet
    Attached Files Attached Files

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: VBA code should ask for every sheet to rename

    Hi keshavtale,

    Try below code, just ensure that you have the same order of names & count in each array
    Please Login or Register  to view this content.
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  3. #3
    Forum Contributor
    Join Date
    03-13-2013
    Location
    india
    MS-Off Ver
    excel 2010
    Posts
    427

    Re: VBA code should ask for every sheet to rename

    i want to show inputbox for which sheet you want to rename , if there is four sheet in that workbook then ask four time it means show inputbox four time

  4. #4
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: VBA code should ask for every sheet to rename

    Ok, try this ...
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    03-13-2013
    Location
    india
    MS-Off Ver
    excel 2010
    Posts
    427

    Re: VBA code should ask for every sheet to rename

    ok this is fine , i want just like that , thanks now my problem is solved

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: VBA code should ask for every sheet to rename

    You need to move the prompt into the loop. Also since you are doing this for every sheet you no longer have to ask them for which sheet to rename. You also have to account for blank input, or if the user hits Cancel.

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  7. #7
    Forum Contributor
    Join Date
    03-13-2013
    Location
    india
    MS-Off Ver
    excel 2010
    Posts
    427

    Re: VBA code should ask for every sheet to rename

    thanks Mr. 6StringJazzer you give me perfect code

  8. #8
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Thumbs up Re: VBA code should ask for every sheet to rename

    @keshavtale to make the code more robust & account for user error/invalid data entry as highlighted by 6StringJazzer, I have added more validations to the code ...
    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 code to Copy rename and move sheet to new workbook
    By Excelski in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2019, 03:34 AM
  2. [SOLVED] How to make VBA Sheet rename code run automatically
    By GregM56 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-01-2019, 02:00 PM
  3. [SOLVED] VB code to rename sheet and add sheets
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-26-2017, 05:36 PM
  4. [SOLVED] Help with VBA code to copy and rename a sheet sequentially
    By niftysquirrel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-03-2013, 09:54 AM
  5. [SOLVED] Code to create new sheet and rename, regardless of any other sheets in workbook
    By csh8428 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-19-2012, 02:22 PM
  6. Rename Sheet Tab Code Doesn't Handle Duplicates
    By irose_57 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-28-2011, 01:49 AM
  7. Funtion/Code to rename a sheet/tab
    By teafan in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 12-14-2007, 02:41 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