View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Need help figuring out how to code this macro

And just in case there were any blanks in Column A

Sub CopyFormula()
Dim lngRowRef As Long
lngRowRef = Range("A" & Rows.Count).End(xlUp).Row
Range("c1").Resize(RowSize:=lngRowRef).Formula = "=EXACT(A1,B1)"
End Sub


Gord Dibben MS Excel MVP

On Sat, 29 Sep 2007 15:14:43 -0400, "Ron Coderre"
wrote:

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