+ Reply to Thread
Results 1 to 9 of 9

Rename Sheet1 as per the same file name

  1. #1
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    140

    Rename Sheet1 as per the same file name

    Hi,
    I am using a folder where there are several files as per date wise like "Dispatch data 01-09-20", "Dispatch data 02-09-20" etc.
    I want to rename the "Sheet1" as per the same file name. The same i need for all the files in the available folder. Thanks.

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Rename Sheet1 as per the same file name

    Try

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Rename Sheet1 as per the same file name

    for a directory where the files are closed, choose your sub directory. This sub can be run from any file. No Error Trapping in code.

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    140

    Re: Rename Sheet1 as per the same file name

    Thanks Mr. Maniacb,
    The code given by you working for an Individual sheet but for the directory it is not working. I have only chaned the below line but not work.
    Please Login or Register  to view this content.
    Also the code is selecting only folder and not subfolder. Please add this one also.

  5. #5
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    140

    Re: Rename Sheet1 as per the same file name

    Sorry Mr. Mani,
    The subfolder code is selecting the sub folder but not provide the rename to sheets.
    I have just changed the below line.

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

  6. #6
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    140

    Re: Rename Sheet1 as per the same file name

    Dear Mr. Mani,
    Now i have added the below line and the code "rename_closed" is workinf fine.

    Please Login or Register  to view this content.
    Only one issue is coming in both codes that the renamed file with extention like "Dispatch data 01-09-20" in place it was mentioned "Dispatch data 01-09-20.xlsx" which need to avoid the extention.
    Request to help.

  7. #7
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Rename Sheet1 as per the same file name

    This code will now remove the extension. Here is the whole thing. Let me know if you have any further questions.

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    140

    Re: Rename Sheet1 as per the same file name

    Dear Mr. Mani,
    It's working fine. Thanks for your quick response and help.

  9. #9
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Rename Sheet1 as per the same file name

    Thank you marking the thread as Solved. You may not know, but you can add to ones reputation by selecting the star at the bottom left. I am glad the update works for you.

+ 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] Link excel file to workbook "=IF(ISBLANK('Sheet1!A1),"",'Sheet1!A1) " is this reliable?
    By bala04msw in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-29-2016, 05:39 AM
  2. My File Rename Macro Always Doesn't Rename the Last Three files in the list
    By Enright in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-02-2016, 03:46 PM
  3. Rename worksheet name "Sheet1" in VBA
    By skchow in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2013, 03:06 AM
  4. Copy Sheet1 from Closed file Paste to Sheet1 in New file
    By cariwest in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-01-2013, 02:13 PM
  5. [SOLVED] A button to create Sheet2, copy there data from Sheet1 and rename the sheet?
    By mintymike in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-17-2012, 10:34 AM
  6. copying bold data from sheet1 to create new worksheets and rename the worksheet
    By ramdzan in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-03-2011, 11:33 AM
  7. Rename sheets to default Sheet1, Sheet2, Sheet3 etc
    By vjboaz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-09-2009, 02:20 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