LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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?




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula Macro Michael M Excel Worksheet Functions 6 November 11th 06 10:20 PM
macro or formula CMD Excel Programming 2 October 4th 06 08:58 PM
Formula expected end of statement error, typing formula into cell as part of VBA macro [email protected] Excel Programming 1 July 20th 06 07:58 PM
Macro Formula Corey Excel Discussion (Misc queries) 1 February 4th 06 06:13 PM
can I add to a formula in a macro? InfinityDesigns Excel Programming 0 June 10th 05 05:03 AM


All times are GMT +1. The time now is 10:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"