View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Trevor Shuttleworth Trevor Shuttleworth is offline
external usenet poster
 
Posts: 1,089
Default Formula in a Macro

I assume you actually meant B1-A1 in cell C1 otherwise I think you'd get
circular references.

One way:

Range("C1").AutoFill _
Destination:=Range("C1:C" & Range("B1").End(xlDown).Row), _
Type:=xlFillDefault

Regards

Trevor


"Todd" wrote in message
...
I hope this is an easy question. I can't seem to figure it out.

I have a very simple spreadsheet that I am writing a macro for.
Basically,
I have written a formual in colum C that says, =B1 - C1, then copied it
down
all the rows of Column C.

A B C
21 55 34

Question is, when I apply this macro to spreadsheets of varying lengths,
it
doesn't stop at the last value. How do I specify the range so this will
work on spreadsheets of different sizes?