Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Shawn, try the listindex property of the listbox if it is -1 no item is
selected: Private Sub cmbContinue_Click() if usfSiteSelection.lsbSelectSite.listindex = -1 then msgbox "Please select an item in the list box", vbokonly, "Selection..." else usfSiteSelection.lsbSelectSite.SetFocus ' I don't think you need this. Sheets("Daily Log").Range("C2").Value = _ usfSiteSelection.lsbSelectSite.Value end if -- Hope this helps Martin Fishlock Please do not forget to rate this reply. "Shawn" wrote: I have a listbox lsbSelectSite on useform usfSiteSelection. I also have a "Continue" Button. The list box list comes from a range of cells elsewhere in the file. When I click the continue button I want cell C2 in Sheet "Daily Log" to equal the value the user has scrolled to in the list box. My problem is the list box option has not been selected. Here is my code as it stands. The SetFocus is the prblem. Private Sub cmbContinue_Click() usfSiteSelection.lsbSelectSite.SetFocus Sheets("Daily Log").Range("C2").Value = usfSiteSelection.lsbSelectSite.Value End Sub -- Thanks Shawn |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem with Pick List associated cell | Excel Discussion (Misc queries) | |||
Select a list in 1 cell by selecting an item from another list in | Excel Discussion (Misc queries) | |||
List Problem--Please help? | Excel Discussion (Misc queries) | |||
change a vertical list of numbers to horizontal list from 1 cell | Excel Discussion (Misc queries) | |||
List ? - How do I make information in one cell determine list to u | Excel Worksheet Functions |