Rx_
Nothing In Moderation
- Local time
- Today, 14:53
- Joined
- Oct 22, 2009
- Messages
- 2,803
Problem: VLookup Drop-Down list box shows all values. But, the associated lookup for VLookup works for some values, but not for others.
This code uses an Excel drop-down list based on the first column of a Named Range
The cells to the right of the drop-down list lookup up columns 5 to 24 in the Named Range and basically show the row.
This code puts the formula in the Excel Workbook from Access code via remote automation. This way, the end usercan select from the drop-down listbox, and the associated row shows up in the cells to the right.
This code uses an Excel drop-down list based on the first column of a Named Range
The cells to the right of the drop-down list lookup up columns 5 to 24 in the Named Range and basically show the row.
This code puts the formula in the Excel Workbook from Access code via remote automation. This way, the end usercan select from the drop-down listbox, and the associated row shows up in the cells to the right.
Code:
3660 objxl.Range("E4").Select
3670 objxl.ActiveCell.FormulaR1C1 = "=VLOOKUP(Drop_Down,Matrix_Values,4)" ' Offset at 5 R_58 '
3680 For MyCounter = 5 To 24
3690 objxl.ActiveCell.Offset(0, 1).Range("A1").Select
3700 objxl.ActiveCell.FormulaR1C1 = "=VLOOKUP(Drop_Down,Matrix_Values, " & MyCounter & ")"
3710 Next MyCounter