Copying Formulas Down Rows

  • Thread starter Thread starter J
  • Start date Start date
J

J

Hi there, I'm new to this group but I have a problem with Excel. Here
is the code I am using.

Sub AutoFillEquation()

Range("R4:AI4").AutoFill Destination:= _
Range("R4:AI" & Range("A" & Rows.Count).End(xlUp).Row), _
Type:=xlFillDefault


End Sub

The problem is that it does fill down the equations but they are not
calculating the values in the cells. It seems as if the values of the
first row are simply being pasted to the end (eventhough when I click
on the cell it displays the correct equation.

For example, in cell R9 there is the equation =I9+J9. The values in I9
and J9 are 5 and 7, respectively. However the answer in I9, as well as
every other value in column I, is 537 (the correct value for row 1 in
that column. When I retype the equation and hit enter it does work
however, but the macro is not working correctly. The reason I need the
macro is due to the changing number of rows and the file could get very
large otherwise.

Thanks for the help

Justin
 
or you could try this at the beginning of your sub:

Application.Calculation = xlCalculationAutomatic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top