Var

  • Thread starter Thread starter Ionan
  • Start date Start date
I

Ionan

I have found the code below on a website but am trying to
amend it for my use.

PrintDlg = Dialogue sheet
cb = Checkbox
What I want is the value of the check box copied to a var
that i can use later in my program.

Does any one know how to do this...many many thanks from a
clueless amateur

currentSheet.Activate
Application.ScreenUpdating = True
If SheetCount <> 0 Then
If PrintDlg.Show Then
For Each cb In PrintDlg.CheckBoxes
If cb.Value = xlOn Then

'Worksheets(cb.Caption).Activate
'ActiveSheet.PrintOut
' 'ActiveSheet.PrintPreview 'for
debugging
End If
Next cb
End If
Else
MsgBox "All worksheets are empty."
End If
 
Ionan,

currentSheet.Activate
Application.ScreenUpdating = True
If SheetCount <> 0 Then
If PrintDlg.Show Then
For Each cb In PrintDlg.CheckBoxes
If cb.Value = xlOn Then
cvValue = cb.Value '<=============
'Worksheets(cb.Caption).Activate
'ActiveSheet.PrintOut
' 'ActiveSheet.PrintPreview 'for
debugging
End If
Next cb
End If
Else
MsgBox "All worksheets are empty."
End If


Make sure that you dedclare vcbValue as a boolean variable outside of any
macro. You van then use it later just as the checkbox value.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top