Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get Cell Address From Lookup (Alternative to Lookup) ryguy7272 Excel Worksheet Functions 12 September 28th 07 10:36 PM
Finding Cell Address from Listbox Eubanks Excel Programming 4 December 23rd 06 08:04 PM
Cell address in a given selection range. Dev Excel Programming 1 June 22nd 06 09:06 PM
Listbox Cell Selection Brian C Excel Programming 3 March 28th 06 07:56 PM
Capture listbox selection to a cell in a different sheet Marcie Excel Programming 2 September 19th 03 12:15 PM


All times are GMT +1. The time now is 04:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"