Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create a activecell from the listbox?
Hi
Does anyone have a code for making my selection in a listbox on a form my activecell in the worksheet. Thanks in advance |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create a activecell from the listbox?
Making several assumptions:
Private Sub Listbox1_Click() Dim rng as Range set rng = Range(me.Listbox1.RowSource) rng.columns(1).Cells(me.Listbox1.ListIndex + 1).Select End Sub -- Regards, Tom Ogilvy "Oggy" wrote in message oups.com... Hi Does anyone have a code for making my selection in a listbox on a form my activecell in the worksheet. Thanks in advance |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create a activecell from the listbox?
On the form you presumably have an ok or goto button (here CommandButton1)
and a the double_click event for the list box (here ListBox1). Set up these three sub as try it would assuming you have a the two controls. Private Sub CommandButton1_Click() ActiveSheet.Range(ListBox1.Value).Select Me.Hide Unload Me End Sub Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean) CommandButton1_Click End Sub Private Sub UserForm_Initialize() ListBox1.AddItem "A1" ListBox1.AddItem "B2" ListBox1.AddItem "C3" End Sub -- Hope this helps Martin Fishlock, Bangkok, Thailand Please do not forget to rate this reply. "Oggy" wrote: Hi Does anyone have a code for making my selection in a listbox on a form my activecell in the worksheet. Thanks in advance |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create a activecell from the listbox?
Activecell.value = Me.ListBox1.Value
-- --- HTH Bob (change the xxxx to gmail if mailing direct) "Oggy" wrote in message oups.com... Hi Does anyone have a code for making my selection in a listbox on a form my activecell in the worksheet. Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
If activecell.column = variable then activecell,offset (0,1) | Excel Discussion (Misc queries) | |||
Userform, listbox and ActiveCell. I'm stumped | Excel Programming | |||
CREATE NEW WORKBOOKS BASED ON ACTIVECELL & BUTTON CLICK | Excel Programming | |||
how to drag and drop from a listbox to activecell with vba ? | Excel Programming | |||
Paste Multiple listbox items starting at ActiveCell | Excel Programming |