Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have to apply vlookup formula to a range which is nto pre-defined.The script must identify the last row in a column and than apply the formula after the last used row and 500 cells below that. What I have done is found then Last row using: LastRow = objExcel.Cells.Find(What:="*", After:=objExcel.Range("A1"), _ searchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row I use the following formula for Vlookup for an identified range: Range("$B2:B1000").Formula = _ "=VLOOKUP($A2,'SAP DATA'!$A$12:$B$1000,2,FALSE)" I replace the above formula as below: Range("$B"&LastRow &:$1000).Formula = _ "=VLOOKUP($A2,'SAP DATA'!$A$12:$B$1000,2,FALSE)" This gives syntax error. It would be rally nice if someone can tell me how can I pass this variable to the Range.I tried various other options but it doesnot seem to work. Thanks a lot. Thanks and Regards, shal |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Applying Formulas to a Range in a Worksheet | Excel Discussion (Misc queries) | |||
Applying Conditional Formatting to a Max number in range | Excel Worksheet Functions | |||
Applying Offset to Range in VBA | Excel Worksheet Functions | |||
Applying data range to column width | Charts and Charting in Excel | |||
Applying formula to only NON-EMPTY cells in range | Excel Discussion (Misc queries) |