+ Reply to Thread
Results 1 to 7 of 7

Rename Sheet If

  1. #1
    Registered User
    Join Date
    03-09-2011
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2010
    Posts
    31

    Rename Sheet If

    Good Evening,

    I need your help to rename a sheet base on the name.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Rename Sheet If

    This will work

    Please Login or Register  to view this content.
    Last edited by mike7952; 03-06-2013 at 01:45 PM.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    03-09-2011
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Rename Sheet If

    Thank you for your reply.
    Unfortunately no working with the MsgBox "Wrong Spreadsheet .....", even the sheet is "Order_Export"

    Devcon

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Rename Sheet If

    This line test if the worksheet name exists in the active workbook. If 1 of the worksheets does not exists it will throw the message.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-09-2011
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Rename Sheet If

    Dear mike7952,

    The sheet name is "Order_Export" or "ExportDataOne".
    The workbook name is "Order.xlsx".
    Now if run the VBA a message say "Wrong Spreadsheet .....".
    I believe that you reference to "A1" which is wrong reference.

    Thank you.

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Rename Sheet If

    A1 is not a wrong Reference, A1 is a cell Ref and every sheet has cell A1.

    See attached workbook
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-09-2011
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Rename Sheet If

    Dear mike7952,

    Probably wrongly I have expressed the query.

    This spreadsheet is opened from an Access query that sometimes the worksheet is called 'Order_Export' or 'ExportDataOne'.
    Depending on how you call the worksheet (one sheet only) should be renamed to 'Request For Quotations'.

    Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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