Thread: Listbox problem
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Stuart[_5_] Stuart[_5_] is offline
external usenet poster
 
Posts: 413
Default Listbox problem

From the module, this calls the form:
GetUserWkbkPrintOptions.Show

then in the form:
Private Sub UserForm_Initialize()
'Fill the ListBox
With GetUserWkbkPrintOptions.ListBox1
.RowSource = ""
.AddItem "You want to hide the same Columns"
etc
etc
.AddItem "You don't want to print any blank pages"
End With
GetUserWkbkPrintOptions.Show
End Sub

The form shows and user makes their selection.
Clicking the OKButton hides the form and returns to the
module code:

'get user's workbook-specific print options
With GetUserWkbkPrintOptions.ListBox1
If GetUserPrintOptions.ListBox1.Selected(0) = True Then
Wkbk_HideSameCols = True
End If
etc.

When I step through all appears ok, but when the routine
returns to the above last code, it simply checks each line for
True or False....it doesn't pick up the Selected items from
the Listbox.

What am I doing wrong, please?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.509 / Virus Database: 306 - Release Date: 12/08/2003