LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 145
Default CheckBox to select pages to print?

Yes, you are right. My suggestion would only work if the first checkbox was
selected each time, which is not realistic.

--

Damon Longworth

2007 Excel / Access User Conference
London, England - Currently rescheduled
St. Louis, Missouri - Oct 24-26, 2007
www.ExcelUserConference.com/


"Dave Peterson" wrote in message
...
I think you'll need something more like this:

Dim FirstSheet as boolean
FirstSheet = true

If PhaseCheckBox.Value = True Then
sheets("131 Phase1").select firstsheet
firstsheet = false
sheets("131 Phase1").select firstsheet
end if

if shopcheckbox.value = true then
sheets("131 shop1").select firstsheet
firstsheet = false
sheets("131 shop2").select firstsheet
end if

if rfcheckbox.value = true then
sheets("Rf Sheet").select firstsheet
firstsheet = false
end if

if statuscheckbox.value = true then
sheets("Status").select firstsheet
firstsheet = false
end if

if firstsheet = true then
'never changed to false, so no sheets were chosen
msgbox "No sheets selected"
else
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
end if





If RFCheckBox.Value = True Then RF = "RF Sheet" Else RF = ""
If StatusCheckBox.Value = True Then Status = "STATUS" Else Status ""

Damon Longworth wrote:

Leave the false off of the first select and it will not include the active
sheet.

If PhaseCheckBox.Value = True Then Sheets("131 Phase1").select
If PhaseCheckBox.Value = True Then sheets( "131 Phase2").select false
If PhaseCheckBox.Value = True Then sheets( "131 Shop1").select false
.......
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

--

Damon Longworth

2007 Excel / Access User Conference
London, England - Currently rescheduled
St. Louis, Missouri - Oct 24-26, 2007
www.ExcelUserConference.com/

"Darkstar" wrote in message
...
This seems to work good but you are right I do have the current active
sheet
that I don't want to print. I don't know of anyway arround this. Since I
don't know witch sheets will be selected to print I don't know how i could
remove the FALSE from the first one.

"Damon Longworth" wrote in message
...
I am assuming your "Then" statements are the sheet names. Try something
similar to:

If PhaseCheckBox.Value = True Then Sheets("131 Phase1").select false
If PhaseCheckBox.Value = True Then sheets( "131 Phase2").select false
.......
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True


Using Select with False will group the sheet with the current active
sheet.
You may need to adjust to deal with the current active sheet or remove
false
from the first line.




--

Damon Longworth

2007 Excel / Access User Conference
London, England - Currently rescheduled
St. Louis, Missouri - Oct 24-26, 2007
www.ExcelUserConference.com/


"Darkstar" wrote in message
...
I tried this but when the varible is empty it calses an error. I can't
figure out any way around this. Thanks for any help.

Dim Phase1, Phase2, Shop1, Shop2, RF, Status

If PhaseCheckBox.Value = True Then Phase1 = "131 Phase1" Else Phase1 =
""
If PhaseCheckBox.Value = True Then Phase2 = "131 Phase2" Else Phase2 =
""
If ShopCheckBox.Value = True Then Shop1 = "131 Shop1" Else Shop1 = ""
If ShopCheckBox.Value = True Then Shop2 = "131 Shop2" Else Shop2 = ""
If RFCheckBox.Value = True Then RF = "RF Sheet" Else RF = ""
If StatusCheckBox.Value = True Then Status = "STATUS" Else Status ""

Sheets (Array(Phase1, Phase2, Shop1, Shop2, RF, Status)).select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True



--

Dave Peterson


 
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
Number of pages in worksheet doesn't match Print Preview pages delru Excel Discussion (Misc queries) 2 May 10th 10 10:08 PM
Can I have a box appear to select the number of pages to print Husker87 Excel Programming 0 February 13th 06 08:37 PM
Print column headers on select pages only RonJ Excel Discussion (Misc queries) 2 December 8th 05 08:29 PM
Can I automatically select the number of pages to print? Husker87 Excel Programming 0 November 26th 05 04:26 AM
Macro to Select Pages & Show Print Ad Excel Programming 1 July 22nd 03 11:44 AM


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

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"