Change TAB Name

mmayna03

New Member
Joined
Jan 27, 2005
Messages
24
I have looke at threads asking the same question to some degree. I have tried some of the recommended marco solutions, but not solve my requirement.

I run a raw data report each day and use a Cygwin shell script to group and create up to 20 separate .csv reports. They are all named based upon their warehouse number. Before I can run the macro to pretty up the report and save it as .xlsx file, I have to manually rename the .csv or change the tab name.

Is there way to change the tab name from A11_NSF_Report to NSF_Report? The other reports will have B23, C21, etc before the "_NSF_Report.

I want to use a single macro and stop wasting time manually deleting the warehouse name.

Thanks,

Michael
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Code:
Worksheets(1).Name = "NSF_Report"
 
Upvote 0
Code:
Sub OpenFiles()
Dim MyFolder As String
Dim MyFile As String
MyFolder = "C:\...\...\Desktop\New folder"
MyFile = Dir(MyFolder & "\*.xls")
Do While MyFile <> ""
Workbooks.Open Filename:=MyFolder & "\" & MyFile
Worksheets(1).Name = "NFS_Report"
MyFile = Dir
ActiveWorkbook.Close SaveChanges:=True

Change ... to your subfolders
Loop
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,723
Messages
6,174,113
Members
452,545
Latest member
boybenqn

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top