Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Listbox query
Hi all how can I change the code below to copy the selected line from the
listbox and copy it to a sheet called popup. The code I received from someone before workgreat in removing a message from another userform but I would like to change it a little. Private Sub CommandButton2_Click() Worksheets("Messages").Range("A2").Offset(ListBox1 .ListIndex).Entirerow.Dele te End Sub Thanks again Greg |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Listbox query
Maybe...
Private Sub CommandButton2_Click() dim destCell as range with worksheets("Popup") set destcell = .cells(.rows.count,"A").end(xlup).offset(1,0) end with with listbox1 if .listindex -1 then destcell.value = .list(.listindex) end if end with end sub Greg B wrote: Hi all how can I change the code below to copy the selected line from the listbox and copy it to a sheet called popup. The code I received from someone before workgreat in removing a message from another userform but I would like to change it a little. Private Sub CommandButton2_Click() Worksheets("Messages").Range("A2").Offset(ListBox1 .ListIndex).Entirerow.Dele te End Sub Thanks again Greg -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Listbox query
Thanks Dave will give it a go
Greg "Dave Peterson" wrote in message ... Maybe... Private Sub CommandButton2_Click() dim destCell as range with worksheets("Popup") set destcell = .cells(.rows.count,"A").end(xlup).offset(1,0) end with with listbox1 if .listindex -1 then destcell.value = .list(.listindex) end if end with end sub Greg B wrote: Hi all how can I change the code below to copy the selected line from the listbox and copy it to a sheet called popup. The code I received from someone before workgreat in removing a message from another userform but I would like to change it a little. Private Sub CommandButton2_Click() Worksheets("Messages").Range("A2").Offset(ListBox1 .ListIndex).Entirerow.Dele te End Sub Thanks again Greg -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Listbox query
Just a little bit more on that, Sorry I didn't explain too well, I need it
to copy the whole line. The listbox's rowsource is a2:e65536 Thanks again Greg "Greg B" wrote in message ... Thanks Dave will give it a go Greg "Dave Peterson" wrote in message ... Maybe... Private Sub CommandButton2_Click() dim destCell as range with worksheets("Popup") set destcell = .cells(.rows.count,"A").end(xlup).offset(1,0) end with with listbox1 if .listindex -1 then destcell.value = .list(.listindex) end if end with end sub Greg B wrote: Hi all how can I change the code below to copy the selected line from the listbox and copy it to a sheet called popup. The code I received from someone before workgreat in removing a message from another userform but I would like to change it a little. Private Sub CommandButton2_Click() Worksheets("Messages").Range("A2").Offset(ListBox1 .ListIndex).Entirerow.Dele te End Sub Thanks again Greg -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Listbox query
You have a followup to your other post.
Greg B wrote: Just a little bit more on that, Sorry I didn't explain too well, I need it to copy the whole line. The listbox's rowsource is a2:e65536 Thanks again Greg "Greg B" wrote in message ... Thanks Dave will give it a go Greg "Dave Peterson" wrote in message ... Maybe... Private Sub CommandButton2_Click() dim destCell as range with worksheets("Popup") set destcell = .cells(.rows.count,"A").end(xlup).offset(1,0) end with with listbox1 if .listindex -1 then destcell.value = .list(.listindex) end if end with end sub Greg B wrote: Hi all how can I change the code below to copy the selected line from the listbox and copy it to a sheet called popup. The code I received from someone before workgreat in removing a message from another userform but I would like to change it a little. Private Sub CommandButton2_Click() Worksheets("Messages").Range("A2").Offset(ListBox1 .ListIndex).Entirerow.Dele te End Sub Thanks again Greg -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
listbox in excel that is an option for sql query | Excel Discussion (Misc queries) | |||
Using a ListBox selection to query a database | Excel Discussion (Misc queries) | |||
Listbox Query Again | Excel Discussion (Misc queries) | |||
listbox query | Excel Programming | |||
Must be better way...Using Listbox Selection to Query Data | Excel Programming |