Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have inherited a worksheet which has a macro that places the selectio
from a listbox into a cell on a worksheet. That becomes the range tha is placed on the main worksheet when the user clicks ok. The proble is that range is then placed wherever the cursor is in the mai worksheet. I need to alter or add to the vba language to make th selection go to the first empty row in column A so that the user canno place the entry anywhere but in column A. Could anyone please look a this for me? Thank you in advance for any suggestions Private Sub CommandButton1_Click() 'if the listindex of listbox equals -1 ... nothing selected If ListBox1.ListIndex = -1 Then MsgBox "No item selected", vbExclamation Exit Sub End If Range("SelectionLink") = ListBox1.ListIndex + 1 Selection.Cells(1) = Worksheets("Products").Range("D1") Selection.Cells(1).Offset(0, 1) = Worksheets("Products").Range("E1") Unload Me End Su -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Limiting selection in a cell AND linking that selection to a list | Excel Discussion (Misc queries) | |||
Remove empty cells from named list / validation list | Excel Worksheet Functions | |||
validation list--list depends on the selection of first list | New Users to Excel | |||
limit cell list selection based on the selection of another list | Excel Worksheet Functions | |||
Selection of non-empty cells | Excel Programming |