PDA

View Full Version : Macro: Variable in find excel function ?



reVidia
09-10-2008, 10:55 PM
Hi, I got 2 spreadsheet, one with the raw data and another with a list of keywords to find.

I am writing a macro to automatically find from a column of keywords 1 by 1, but how do I actually use a variable in the find formula ?

For example

For i = 1 To 5
Range("H2").Select
ActiveCell.FormulaR1C1 = _
"=ISNUMBER(FIND('[Tracking.xls]Sheet1'!R2C2 <---- use i ? ,RC[-4]))"
Next i

It doesn allow me to put a variable as part of the argument it seems

Bob Phillips
09-11-2008, 01:00 AM
For i = 1 To 5
Range("H2").FormulaR1C1 = _
"=ISNUMBER(FIND('[Tracking.xls]Sheet1'!R2C" & i & ",RC[-4]))"
Next i