View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
patrick molloy patrick molloy is offline
external usenet poster
 
Posts: 391
Default IF Command to Stop Macro

change:

index = index + 1
ws.Cells(index, 1) = sFileName
CopySheets sFileName
activesheet.Name = "Sheet_" & Index ''NEW LINE
sFileName = Dir()


The new line simply changes th ecactive sheet's name to
Sheet_nn
where nn is the index numbe. You might want to use a
function for this in case a sheet with the same name
already exists.

Application.DisplayAlerts=False
worksheets(n).Delete
Application.DisplayAlerts=True

where n can be a number or a sheet name

regards

Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
Would it be possible to make the macro name the sheets
1,2,3,4,5,6,7,8......

How would you then make a macro that delete's the newly

copied sheets
from the current worksheet?


---
Message posted from http://www.ExcelForum.com/

.