I am pulling my hair out in frustration with this right now. I have a .csv file that I am attempting to run a macro on. I will need to move between tabs, and want to rename a tab to remove the date as it is not consistent in format. I have tried numerous ways, and I don't get an error message, but the tab is not renamed either. Code I have tried is below.
VB:ActiveSheet.Name = "ReportName"Thanks for the help.VB:Dim WsName As String With ActiveSheet WsName = .Name End With Sheets(WsName).Name = "ReportName"
Last edited by Dave Hawley; January 10th, 2007 at 21:36.
See attached file where it works for me.
Can you attach a small part of it here for us to to play around with it?
Last edited by Wigi; January 10th, 2007 at 19:46.
Sorry, didn't notice the new reply before I posted the last one.
And in creating the sample data I figured out that the tab is named by what the worksheet is named. Is there a way to turn this off, or override it?
Sample is attached
Don't know what is going on here. I open your file, go to VBA editor alt-f11, then do Insert > Module, and type this:
I run the code and it does the renaming.VB:Sub renamesheet() Sheets("tab name example").Name = "Wigi" End Sub
Try this also.
It worked for me also, but I can't upload the .csv, so had to change it to .xls. How much of a difference would this make?
The other issue is that the tab has the date in it, so is there another way I could do it with just ActiveSheet since the date format changes?
There are currently 1 users browsing this thread. (0 members and 1 guests)