View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default need a macro to drop excel sheets that were not populated

Try this
Sub idsheets()
Application.DisplayAlerts = False
For i = Sheets.Count To 2 Step -1
If Sheets(i).UsedRange.Cells(1, 1) = "" Then
Sheets(i).Delete
End If
Next i
Application.DisplayAlerts = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"James" wrote in message
...
I need a macro to export only the first sheet of a workbook and the sheet
that was populated. ie: first sheet always in use with hyperlinks to other
sheets. once a hyperlinked sheet is chosen and populated I need a button
called export to only save the first sheet and the sheet populated
dropping
off all the other sheets not used with the outcome of a new workbook to
save
and e-mail. Any help would be greatful. Thank you