Home |
Search |
Today's Posts |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Number of pages in worksheet doesn't match Print Preview pages | Excel Discussion (Misc queries) | |||
Can I have a box appear to select the number of pages to print | Excel Programming | |||
Print column headers on select pages only | Excel Discussion (Misc queries) | |||
Can I automatically select the number of pages to print? | Excel Programming | |||
Macro to Select Pages & Show Print | Excel Programming |