Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
J J is offline
external usenet poster
 
Posts: 4
Default Copying Formulas Down Rows

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Copying Formulas Down Rows

Try adding CALCULATE to your code.

"J" wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
J J is offline
external usenet poster
 
Posts: 4
Default Copying Formulas Down Rows

Please explain how to use calculate and where to place in code.



Barb Reinhardt wrote:
Try adding CALCULATE to your code.

"J" wrote:

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 964
Default Copying Formulas Down Rows

Place in the final line before your End Sub.

Calculate
End Sub

HTH,
Elkar


"J" wrote:

Please explain how to use calculate and where to place in code.



Barb Reinhardt wrote:
Try adding CALCULATE to your code.

"J" wrote:

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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Copying Formulas Down Rows

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

Application.Calculation = xlCalculationAutomatic

"J" wrote:

Please explain how to use calculate and where to place in code.



Barb Reinhardt wrote:
Try adding CALCULATE to your code.

"J" wrote:

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






Reply
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
copying formulas when inserting new rows Steve M[_4_] Excel Discussion (Misc queries) 7 September 8th 08 02:55 PM
Inserting multiple rows and copying formulas [email protected] Excel Discussion (Misc queries) 3 September 13th 07 03:24 PM
Copying rows/formulas erikcw[_2_] Excel Programming 1 November 22nd 05 05:03 PM
SOS - My formulas aren't computing down my rows but copying same Sharon S Excel Worksheet Functions 4 September 21st 05 05:55 PM
Counting Rows/Columns for Copying Formulas SamDev Excel Discussion (Misc queries) 0 June 24th 05 04:13 AM


All times are GMT +1. The time now is 02:26 AM.

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"