LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Cell Value = to List Box Value Problem

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Pick List associated cell Ty Excel Discussion (Misc queries) 2 February 11th 10 01:05 PM
Select a list in 1 cell by selecting an item from another list in Jonners Excel Discussion (Misc queries) 2 July 10th 09 10:31 PM
List Problem--Please help? Frank_Horbelt Excel Discussion (Misc queries) 1 December 12th 06 08:07 PM
change a vertical list of numbers to horizontal list from 1 cell caz Excel Discussion (Misc queries) 3 September 27th 06 12:11 PM
List ? - How do I make information in one cell determine list to u Brad_A Excel Worksheet Functions 1 January 18th 05 04:10 PM


All times are GMT +1. The time now is 07:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"