View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
pikapika13 pikapika13 is offline
external usenet poster
 
Posts: 1
Default MACRO FOR PIVOT TABLE


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