Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default List Box catalyst to cell reference

I would like that when an option is chosen in a list box
it changes the reference for certain cells. If the first
option is chosen then cell a4 = another workbook sheet1
cell g18 If the second option is chosen then cell a4 =
another workbook sheet2 cell b15. I tried to use the IF
formula but i guess i do may not properly understand how
to put the object into the formula. If this can be done in
VB i would apreciate that as well. Thanks for any help.

Markus
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default List Box catalyst to cell reference

You could use the ListIndex property, which is zero-based so the first item
in the list is the 0th item in VBA:

Select Case ListBox1.ListIndex
Case 0 'First item in list
Range("A4").Value = Workbooks("OtherBook"). _
Worksheets("Sheet1").Range("G18").Value
Case 1 'Second item in list
Range("A4").Value = Workbooks("OtherBook"). _
Worksheets("Sheet2").Range("B15").Value
'etc
End Select

rename ListBox1 to whatever the name of your listbox is.

For more information for listboxes see www.rubbershoe.com/listbox.htm

Hth,
Tim Zych

"Markus" wrote in message
...
I would like that when an option is chosen in a list box
it changes the reference for certain cells. If the first
option is chosen then cell a4 = another workbook sheet1
cell g18 If the second option is chosen then cell a4 =
another workbook sheet2 cell b15. I tried to use the IF
formula but i guess i do may not properly understand how
to put the object into the formula. If this can be done in
VB i would apreciate that as well. Thanks for any help.

Markus



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
How to get the cell reference of the value selected from name list YY san.[_2_] Excel Worksheet Functions 3 March 7th 09 06:52 PM
Drop down list - need to reference and populate another cell with KateW Excel Discussion (Misc queries) 7 January 8th 09 06:56 PM
Function to use a list box or reference a cell Dan Excel Worksheet Functions 1 November 18th 08 09:26 PM
cell reference to last item in a list Lee Excel Discussion (Misc queries) 1 February 2nd 05 08:07 PM
Place a set value in a cell from a drop down list name reference Alan Lipscomb Excel Worksheet Functions 1 November 6th 04 12:07 AM


All times are GMT +1. The time now is 10:35 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"