ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy text from a List box to a Cell! (https://www.excelbanter.com/excel-programming/277504-copy-text-list-box-cell.html)

patrick molloy

Copy text from a List box to a Cell!
 
assign a macro to the list box's change event that simply
copies the listbox's linked cell to the selected cell...

Sub DropDown1_Change()
Selection.Value = Range("N6").Value
End Sub
In this sprocedure, N6 is the listbox's linked cell. when
a valuie in the list is selected, the macro is called and
hte value copied from N6 to the selected cell.

If you used the ActiveX listbox, then you'd do it simply
from the obnject's change event....
Private Sub ComboBox1_Change()
Selection = ComboBox1.Value
End Sub


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
I made a List Box from the Form Menu and input a range

of cells
(Notes!$A$2:$A$21) that contain a list of names. What I

would like to do is,
to select a cell and the goto the List Box select a Name

and then it would
just copy that name to the previously selected cell. Is

this possible? or
way to complicated to mess with.
At the moment all I do is select the name from the List

Box and the type the
name into the cell! Its just a list that helps me

remember all the names.

Thank you in advance for all your help!

Kevin Brenner



.


Tom Ogilvy

Copy text from a List box to a Cell!
 

In this sprocedure, N6 is the listbox's linked cell.


Sub DropDown1_Change()
Selection.Value = Range("N6").Value
End Sub


this would copy the listindex, not the selected name.

--
Regards,
Tom Ogilvy


Patrick Molloy wrote in message
...
assign a macro to the list box's change event that simply
copies the listbox's linked cell to the selected cell...

Sub DropDown1_Change()
Selection.Value = Range("N6").Value
End Sub
In this sprocedure, N6 is the listbox's linked cell. when
a valuie in the list is selected, the macro is called and
hte value copied from N6 to the selected cell.

If you used the ActiveX listbox, then you'd do it simply
from the obnject's change event....
Private Sub ComboBox1_Change()
Selection = ComboBox1.Value
End Sub


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
I made a List Box from the Form Menu and input a range

of cells
(Notes!$A$2:$A$21) that contain a list of names. What I

would like to do is,
to select a cell and the goto the List Box select a Name

and then it would
just copy that name to the previously selected cell. Is

this possible? or
way to complicated to mess with.
At the moment all I do is select the name from the List

Box and the type the
name into the cell! Its just a list that helps me

remember all the names.

Thank you in advance for all your help!

Kevin Brenner



.





All times are GMT +1. The time now is 11:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com