+ Reply to Thread
Results 1 to 4 of 4

VB Macro to Rename sheet name

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

    VB Macro to Rename sheet name

    Helllo:

    I have an excel file and after running a small macro the cell D1 will be in the format mmddyyyy. (Date)


    Now i want to check if the sheet name is the same as cell D1.
    If Sheet name is not the as D1 then change the sheet name to D1.
    If Sheet name same then ignore.

    Example D1=06182014
    Need to check if sheet name is 06182014


    Let me Know if you have any questions.
    Thanks.

    Riz

  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,091

    Re: VB Macro to Rename sheet name

    What's the point of checking?
    If Sheet name same then ignore.
    So, it is already equal to D1 => do nothing.
    If Sheet name is not the as D1 then change the sheet name to D1.
    And, if it's not the same, make it equal D1. Either way, it ends up being equal to D1.

    Just make it equal D1.

    Please Login or Register  to view this content.

    Regards, TMS
    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 Macro to Rename sheet name

    Hi TMS:

    Great point and it works.
    Thanks
    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,091

    Re: VB Macro to Rename sheet name

    You're welcome. Thanks for the rep.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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: 4
    Last Post: 08-16-2013, 04:10 AM
  2. Macro open files and copy sheet and rename sheet
    By matrix_xrs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-19-2013, 04:33 AM
  3. Macro to create sheet, rename sheet, and hyperlink to it
    By prescottfarm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2013, 04:46 PM
  4. Macro to rename sheet
    By iplayball in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-12-2012, 07:58 PM
  5. Macro to rename sheet
    By JRD123 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-10-2010, 09:22 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