Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to get the cell reference of the value selected from name list | Excel Worksheet Functions | |||
Drop down list - need to reference and populate another cell with | Excel Discussion (Misc queries) | |||
Function to use a list box or reference a cell | Excel Worksheet Functions | |||
cell reference to last item in a list | Excel Discussion (Misc queries) | |||
Place a set value in a cell from a drop down list name reference | Excel Worksheet Functions |