Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Lookup cell address of listbox selection
Hi.
Could someone help me to achive the following. I have a Userform with a listbox, The source of the listbox is named range on a sheet, I would like that when the user double clicks on a listbox item that the source cell on the sheet is activated. The source range may at times be filtered, however I have configured the listbox to show only the visible cells. Thanks LaDdIe. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Lookup cell address of listbox selection
Hi LaDdIe-
I have something done something similar but with worksheets. Basically when my userform loads it populates a listbox with all the worksheet names in the workbook. Then when I click on the listbox, it takes me to that worksheet. All the listbox_change() event does is loop through all the worksheet names and when it finds a match it goes to that sheet. Private Sub ListBox1_Change() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets If Me.ListBox1.Value = ws.Name Then ws.Select Exit Sub End If Next End Sub Maybe you could loop through the contents of the cells in the named range to find a match in your listbox? For each [cell] in [named range] If Me.ListBox1.Value = [cell].value Then cell.select Exit Sub End If Next .... or something to that effect. John "LaDdIe" wrote: Hi. Could someone help me to achive the following. I have a Userform with a listbox, The source of the listbox is named range on a sheet, I would like that when the user double clicks on a listbox item that the source cell on the sheet is activated. The source range may at times be filtered, however I have configured the listbox to show only the visible cells. Thanks LaDdIe. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Lookup cell address of listbox selection
Bless ur heart!, just what I wanted.
"redeagle" wrote: Hi LaDdIe- I have something done something similar but with worksheets. Basically when my userform loads it populates a listbox with all the worksheet names in the workbook. Then when I click on the listbox, it takes me to that worksheet. All the listbox_change() event does is loop through all the worksheet names and when it finds a match it goes to that sheet. Private Sub ListBox1_Change() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets If Me.ListBox1.Value = ws.Name Then ws.Select Exit Sub End If Next End Sub Maybe you could loop through the contents of the cells in the named range to find a match in your listbox? For each [cell] in [named range] If Me.ListBox1.Value = [cell].value Then cell.select Exit Sub End If Next ... or something to that effect. John "LaDdIe" wrote: Hi. Could someone help me to achive the following. I have a Userform with a listbox, The source of the listbox is named range on a sheet, I would like that when the user double clicks on a listbox item that the source cell on the sheet is activated. The source range may at times be filtered, however I have configured the listbox to show only the visible cells. Thanks LaDdIe. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Get Cell Address From Lookup (Alternative to Lookup) | Excel Worksheet Functions | |||
Finding Cell Address from Listbox | Excel Programming | |||
Cell address in a given selection range. | Excel Programming | |||
Listbox Cell Selection | Excel Programming | |||
Capture listbox selection to a cell in a different sheet | Excel Programming |