Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default need a macro to drop excel sheets that were not populated

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default need a macro to drop excel sheets that were not populated


This works great, I have one problem. I can use this in a new workbook with
unnamed sheets. but when I put it into our template with named sheets I loose
all the sheets but the first one. The other sheets already have questions to
answer so they are pre-populated. Do i need to protect cells that have user
notes in them first.

"Don Guillett" wrote:

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default need a macro to drop excel sheets that were not populated


You didn't say so!!! Always nice to fully state your problem in the first
post.
Perhaps you could delete sheets that don't have something in a PARTICULAR
cell.

If Sheets(i).Cells(1, 1) = "" Then

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"James" wrote in message
...

This works great, I have one problem. I can use this in a new workbook
with
unnamed sheets. but when I put it into our template with named sheets I
loose
all the sheets but the first one. The other sheets already have questions
to
answer so they are pre-populated. Do i need to protect cells that have
user
notes in them first.

"Don Guillett" wrote:

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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Drop Down Box populated by a List Ted_MD Excel Discussion (Misc queries) 1 December 21st 09 03:32 PM
Macro button to print sheets populated from drop-down list AB3 Excel Discussion (Misc queries) 7 July 11th 08 01:03 AM
drop-down populated from external data hll Excel Programming 3 September 7th 07 10:22 PM
macro populated sheets is very good yet something i may miss here. driller Excel Programming 2 July 23rd 07 10:04 PM
Can a cell have a drop down list and can also be auto populated Adrian Excel Worksheet Functions 1 March 17th 05 05:05 AM


All times are GMT +1. The time now is 08:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"