View Single Post
  #5   Report Post  
David Hepner
 
Posts: n/a
Default

This should work for you:

Worksheets("Sheet1").Cells(1, 1).Formula =
"=Search("":"",Sheet2!cells(1,1),1)"

"tam" wrote:

Thanks, David. However, when I used this formula, I got "#NAME?". It looks
like the formula doesn't like the type of cell reference Cells(1,1). If I
changed cells(1,1) to A1, then everything worked fine. However, I have a
long list and I need to do a loop later on.
Regards,
Minh

"David Hepner" wrote:

Try this:

Range("A1").Formula = "=Search("":"",Sheet2!cells(1,1),1)"



"tam" wrote:

cells(1, 1).Formula = "=Search("":"",Sheet2!cells(1,1),1)"
What is wrong with this formula? How do I use this type of cell reference
in a formula?