Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
eme eme is offline
external usenet poster
 
Posts: 3
Default Set Cell value form ListBox.

I want to populate a cell with the user selection from a ListBox.
The sequence of events should be:
1. User positions to a cell that is the receive the data
2. User clicks a command button that executes the Userform/ListBox
3. The code populates and displays the ListBox
4. User selects an item from the listBox by clicking on the item
5. Without any more user actions, the code should end the ListBox/UserForm
and populate the previously selected cell with the ListBox value selected
Items 1 to 4 are working fine, I have trouble to have item 5 automatically
execute

Thanks for your help

  #3   Report Post  
Posted to microsoft.public.excel.programming
eme eme is offline
external usenet poster
 
Posts: 3
Default Set Cell value form ListBox.



Thanks for your response Nigel,

Sorry I was not clear, what I am looking for is the automatic
Close/Cancel of the ListBox & UserForm after the selection is made.
Something like ListBox.Close & UserForm.Close.

I am migrating this VB code form Lotus.123 where it works fine.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default Set Cell value form ListBox.

If the ListBox is on a UserForm then use the UserForm control change event
to populate the currently selected cell and unload the UserForm. Code is in
the UserForm

Private Sub ListBox1_Change()
ActiveCell = ListBox1.Value
Unload Me
End Sub


--

Regards,
Nigel




"eme" wrote in message
...


Thanks for your response Nigel,

Sorry I was not clear, what I am looking for is the automatic
Close/Cancel of the ListBox & UserForm after the selection is made.
Something like ListBox.Close & UserForm.Close.

I am migrating this VB code form Lotus.123 where it works fine.


  #5   Report Post  
Posted to microsoft.public.excel.programming
eme eme is offline
external usenet poster
 
Posts: 3
Default Set Cell value form ListBox.



"Nigel" wrote:

If the ListBox is on a UserForm then use the UserForm control change event
to populate the currently selected cell and unload the UserForm. Code is in
the UserForm

Private Sub ListBox1_Change()
ActiveCell = ListBox1.Value
Unload Me
End Sub


--

Regards,
Nigel




"eme" wrote in message
...


Thanks for your response Nigel,

Sorry I was not clear, what I am looking for is the automatic
Close/Cancel of the ListBox & UserForm after the selection is made.
Something like ListBox.Close & UserForm.Close.

I am migrating this VB code form Lotus.123 where it works fine.


Thanks for the help Nigel,


the bit that i was missing was the UNLOAD, all working now thanks
Reply
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
Listbox in a form Dan Excel Programming 4 June 26th 07 04:21 PM
listbox value to a form alexanderd[_11_] Excel Programming 1 July 17th 05 04:24 PM
vb6 form with listbox RB Smissaert Excel Programming 2 June 2nd 05 11:23 PM
listbox option in form inquirer Excel Programming 2 April 7th 04 02:16 AM
Cell link in a form listbox - can it show a word? Dave Peterson[_3_] Excel Programming 0 January 27th 04 01:58 AM


All times are GMT +1. The time now is 04:26 PM.

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

About Us

"It's about Microsoft Excel"