View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre Ron Coderre is offline
external usenet poster
 
Posts: 2,118
Default Need help figuring out how to code this macro

Try something like this:

Sub CopyFormula()
Dim lngRowRef As Long

lngRowRef = Range("A1").End(xlDown).Row
Range("c1").Resize(RowSize:=lngRowRef).Formula = "=EXACT(A1,B1)"
End Sub

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)

"jefals" wrote in message
...
Have a worksheet as...
a b c
1 x x =exact(a,b)
2 x
3 x x
4 x x

I'm writing a macro, and want to copy the formula in C1 and paste it,
beginning in C2, and continuing to the last row in the worksheet (in the
example, it would C2 thru C4 ).

I know that Col A will be filled in for each row, so my macro could goto
A1
and do and END-DOWN, to get to the bottom row, but how do I then use this
info in my paste command?

THANKS!,
Jeff