S
Stuart
I have an initial form, containing a label, four listboxes an OK
and a Cancel button. The form is designed to get the user's
print options. Here is the module code:
With GetUserPrintOptions
.Show
If .OkButton.Tag = "Selected" Then
If .ListBox1.Selected(0) Then
Global_PrintAllBooks_Sheets = True
End If
If .ListBox2.Selected(0) Then
HideCols = True
With GetUserHideColumnOptions
If .ListBox1.Selected(0) = True Then
Global_HideSameCols = True
End If
End With
End If
If .ListBox3.Selected(0) Then
PrintZeroPages = True
With GetUserPrintZeroPagesOptions
If .ListBox1.Selected(0) = True Then
Global_PrintZeroPages = True
End If
End With
End If
If .ListBox4.Selected(0) Then
PrintBlankPages = True
With GetUserPrintBlankPagesOptions
If .ListBox1.Selected(0) = True Then
Global_PrintBlankPages = True
End If
End With
End If
Else
'Cancel Button was pressed so set defaults
Global_PrintAllBooks_Sheets = False
Global_HideCols = False
Global_PrintZeroPages = False
Global_PrintBlankPages = False
End If
End With
Listboxes 2-4 if Selected, will cause further forms to be presented
where the user is asked if they wish their choice in the
GetUserPrintOptions listbox, is to apply to all worksheets in all
workbooks. If so, then set the relevent Global variable to True.
Problem: I cannot execute this code cleanly.
Quite often I am returned to the original Form, only to find that
one of the listboxes (previously highlighted in blue) has suddenly
cleared itself. I have to repeat the selection of that listbox. Often
this process is repeated with another selected listbox before all
selections are displayed correctly, and I can press OK to exit the
form.
Would be grateful for help, please.
Regards.
and a Cancel button. The form is designed to get the user's
print options. Here is the module code:
With GetUserPrintOptions
.Show
If .OkButton.Tag = "Selected" Then
If .ListBox1.Selected(0) Then
Global_PrintAllBooks_Sheets = True
End If
If .ListBox2.Selected(0) Then
HideCols = True
With GetUserHideColumnOptions
If .ListBox1.Selected(0) = True Then
Global_HideSameCols = True
End If
End With
End If
If .ListBox3.Selected(0) Then
PrintZeroPages = True
With GetUserPrintZeroPagesOptions
If .ListBox1.Selected(0) = True Then
Global_PrintZeroPages = True
End If
End With
End If
If .ListBox4.Selected(0) Then
PrintBlankPages = True
With GetUserPrintBlankPagesOptions
If .ListBox1.Selected(0) = True Then
Global_PrintBlankPages = True
End If
End With
End If
Else
'Cancel Button was pressed so set defaults
Global_PrintAllBooks_Sheets = False
Global_HideCols = False
Global_PrintZeroPages = False
Global_PrintBlankPages = False
End If
End With
Listboxes 2-4 if Selected, will cause further forms to be presented
where the user is asked if they wish their choice in the
GetUserPrintOptions listbox, is to apply to all worksheets in all
workbooks. If so, then set the relevent Global variable to True.
Problem: I cannot execute this code cleanly.
Quite often I am returned to the original Form, only to find that
one of the listboxes (previously highlighted in blue) has suddenly
cleared itself. I have to repeat the selection of that listbox. Often
this process is repeated with another selected listbox before all
selections are displayed correctly, and I can press OK to exit the
form.
Would be grateful for help, please.
Regards.