VBA Copy Formula ?

Pinaceous

Well-known Member
Joined
Jun 11, 2014
Messages
1,124
Office Version
  1. 365
Platform
  1. Windows
Hi All,

In using Excel 2013, how do I copy a formula straight down a Column on command by a macro?

I could use a recorded macro but I'm sure there's a faster way.

Where the formula is "='whatever'" pasting it down Column C:2 to C:573.

Many thanks in advance.

R/
-Pin

:confused:
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Assuming the formula is a simple SUM of A2 +B2
try
Code:
Range("C2:C573").formula = "=Sum(A2:B2)"
 
Upvote 0
Hi Michael M,

I really do appreciate you providing me this code, as I am using this in a series with other codes, as this will really help.

Thanks very much!

R/
Pin
 
Upvote 0
Hey Michael,

I know its been awhile, but, let say your formula was from 'Sheet 1' 'cell' '1A' is to equal 'Sheet 2''cell' '1A'? So the formula in 'Sheet 2' 'cell' '1A' is '=Sheet1!A1'.

Could this formula be inserted in your formula above, so then the next 'Sheet 1' 'cell' '2A' could equal 'Sheet 2' '2A', then this formula could be of 'Sheet 2' 'cell' '2A' being '=Sheet1!A2'; and so on over a specified area?

Thanks,

-Pin
 
Upvote 0

Forum statistics

Threads
1,224,351
Messages
6,178,060
Members
452,822
Latest member
MtC

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top