Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use VBA write formula
Hello Guys,
I want to set a range value to a formula which reference to another closed workbook range. but, I don't know how? example: rng.formulaR1C1="=vlookup("+search+",rng in [another closed workbook]sheetname!"+"r9c9, 9)" thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use VBA write formula
Steve,
Along the lines of: ActiveCell.FormulaR1C1 = _ "=VLOOKUP(" & Search & ",'C:\FolderName\" & _ "[WorkbookName.xls]SheetName'!R1C1:R9C9,9,FALSE)" The R1C1:R9C9 means A1:I9... The easiest way to get the syntax correct is to open both workbooks, make up your formula so that it works, then close the workbook without the formula. Then start the macro recorder, select the cell with the formula, press F2, then press Enter. Turn off the recorder, and take a look at your code. HTH, Bernie MS Excel MVP " wrote in message ... Hello Guys, I want to set a range value to a formula which reference to another closed workbook range. but, I don't know how? example: rng.formulaR1C1="=vlookup("+search+",rng in [another closed workbook]sheetname!"+"r9c9, 9)" thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Write a Formula | Excel Worksheet Functions | |||
Is there a better way to write formula | Excel Discussion (Misc queries) | |||
Write formula to look for 'like' value | Excel Discussion (Misc queries) | |||
How do I write this formula | Excel Discussion (Misc queries) | |||
how do i write a formula and keep in in formula form, so it DOESN. | Excel Discussion (Misc queries) |