LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default include empty sheets

yes I have altered it but now the code in the 4th line is
yellow in the debugger?

im sure it is right!!

' Add the checkboxes
TopPos = 40
For i = 1 To ActiveWorkbook.Sheets.Count
Set CurrentSheet = ActiveWorkbook.Sheets(i)
' Skip hidden sheets
If 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


-----Original Message-----
For i = 1 To ActiveWorkbook.Sheets.Count

Change worksheets to Sheets in the code


--
Regards Ron de Bruin
http://www.rondebruin.nl



wrote in message

...
hi ron,

Thanks

I have altered the code, it has half worked as you said
but how can I include charts i guess i'm wrong here

TopPos = 40
For i = 1 To ActiveWorkbook.Worksheets.Count
Set CurrentSheet = ActiveWorkbook.Worksheets(i)
Set CurrentSheet = ActiveWorkbook.Charts(i)
' Skip hidden sheets
If CurrentSheet.Visible Then
SheetCount = SheetCount + 1


-----Original Message-----
Hi Rob

You can use this instead
If CurrentSheet.Visible Then

But the code use Worksheets
For i = 1 To ActiveWorkbook.Worksheets.Count
This will only count the worksheets and not chart

sheets
if you have them


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Rob" wrote in

message ...
The following code is used in my sheet as part of a
larger code to make a list on a dialogue of all

sheets
in
the workbook. I have seen the part of code

saying "skip
empty sheets" and have come to the conclusion this is

why
the code is missing my charts from the list when I

run
it.

How can I get rid of this part to allow for the

charts
to
show?

Many Thanks - I have been messing around with this

for
hours.

Rob

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
.




.



.



 
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
sort Excel 2007 to include empty row between data? agfox35 Excel Worksheet Functions 2 December 22nd 08 02:05 PM
Don't include category X labels if row empty Sally Poyzer Charts and Charting in Excel 1 August 3rd 06 02:43 AM
How do I not include empty cell value chart labels in pie charts? JMarble Charts and Charting in Excel 1 May 13th 05 08:38 PM
skip empty sheets Rob Excel Programming 2 February 6th 05 01:48 PM
Printing Sheets that only include data oakman[_5_] Excel Programming 3 May 7th 04 01:14 PM


All times are GMT +1. The time now is 01:17 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"