Thnx for the help.
However the sheet I am trying to rename is not an existing sheet. It gets
created from pivot table. It is always "SHEET1". I have been careful about
it. I tried to use the commands as given by you but I again land up with
the same error.
"pikapika13" wrote:
You're getting the error because Sheet1 isn't always the next sheet if
you're running this multiple times.
You probably need to add the first 3 lines below somewhere in the
beginning of your code to delete the "old" Pre Checks (Assuming you
don't need it anymore).
Then replace your
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "Pre Checks"
with
ActiveSheet.Name = "Pre Checks"
Code:
On Error Resume Next
Sheets("Pre Checks").Delete
On Error GoTo 0
ActiveSheet.Name = "Pre Checks"
--
pikapika13
------------------------------------------------------------------------
pikapika13's Profile: http://www.excelforum.com/member.php...o&userid=10892
View this thread: http://www.excelforum.com/showthread...hreadid=570770