Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 234
Default skip empty sheets

I am using a script downloaded from a web page the code
below is missing out my charts from the list of results
due to the skip empty sheets part. Please can someone
tell me how to take it out so the charts are part of the
list!

Thanks

' Add the checkboxes
TopPos = 40
For i = 1 To ActiveWorkbook.Worksheets.Count
Set CurrentSheet = ActiveWorkbook.Worksheets(i)
' Skip empty sheets and hidden sheets
If Application.CountA(CurrentSheet.Cells) < 0
And _
CurrentSheet.Visible Then
SheetCount = SheetCount + 1
PrintDlg.CheckBoxes.Add 78, TopPos, 150, 16.5
PrintDlg.CheckBoxes(SheetCount).Text = _
CurrentSheet.Name
TopPos = TopPos + 13
End If
Next i

' Move the OK and Cancel buttons
PrintDlg.Buttons.Left = 240
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default skip empty sheets

Can you restate or explain what you mean by:

"the code below is missing out my charts from the list of results
due to the skip empty sheets part."

"Rob" wrote:

I am using a script downloaded from a web page the code
below is missing out my charts from the list of results
due to the skip empty sheets part. Please can someone
tell me how to take it out so the charts are part of the
list!

Thanks

' Add the checkboxes
TopPos = 40
For i = 1 To ActiveWorkbook.Worksheets.Count
Set CurrentSheet = ActiveWorkbook.Worksheets(i)
' Skip empty sheets and hidden sheets
If Application.CountA(CurrentSheet.Cells) < 0
And _
CurrentSheet.Visible Then
SheetCount = SheetCount + 1
PrintDlg.CheckBoxes.Add 78, TopPos, 150, 16.5
PrintDlg.CheckBoxes(SheetCount).Text = _
CurrentSheet.Name
TopPos = TopPos + 13
End If
Next i

' Move the OK and Cancel buttons
PrintDlg.Buttons.Left = 240

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default skip empty sheets

I believe he means that if his sheet contains only charts, then the line:

If Application.CountA(CurrentSheet.Cells) < 0
considers it to be "empty" and does not make a checkbox for that sheet. I
would think he should add another test for Objects.Count <0

If Application.CountA(CurrentSheet.Cells) < 0 _
And CurrentSheet.Objects.count <0 _
And CurrentSheet.Visible Then
.... 'make checkboxes
End If

Mike F

"gocush" /delete wrote in message
...
Can you restate or explain what you mean by:

"the code below is missing out my charts from the list of results
due to the skip empty sheets part."

"Rob" wrote:

I am using a script downloaded from a web page the code
below is missing out my charts from the list of results
due to the skip empty sheets part. Please can someone
tell me how to take it out so the charts are part of the
list!

Thanks

' Add the checkboxes
TopPos = 40
For i = 1 To ActiveWorkbook.Worksheets.Count
Set CurrentSheet = ActiveWorkbook.Worksheets(i)
' Skip empty sheets and hidden sheets
If Application.CountA(CurrentSheet.Cells) < 0
And _
CurrentSheet.Visible Then
SheetCount = SheetCount + 1
PrintDlg.CheckBoxes.Add 78, TopPos, 150, 16.5
PrintDlg.CheckBoxes(SheetCount).Text = _
CurrentSheet.Name
TopPos = TopPos + 13
End If
Next i

' Move the OK and Cancel buttons
PrintDlg.Buttons.Left = 240



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
I want the autofill/drag function to skip empty cells tcmcgee Excel Discussion (Misc queries) 1 October 28th 08 04:27 PM
paste special / skip empty cells doesn't work!? Ivica TypeR Excel Worksheet Functions 3 July 10th 07 04:53 PM
SKIP EMPTY ROWS FROM IMPORT R.V. DEURSEN Excel Programming 4 June 28th 04 07:17 PM
How to skip empty cells while running a macro? saziz[_2_] Excel Programming 5 June 10th 04 11:16 PM
Skip empty and text cells Jason Morin[_3_] Excel Programming 3 April 2nd 04 10:22 PM


All times are GMT +1. The time now is 09:49 PM.

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

About Us

"It's about Microsoft Excel"