Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Rick
 
Posts: n/a
Default Circular reference error

I need to do a sum of a column using a macro, but having trouble trying to
determine how to place this sum at the bottom of the same column. I cannot
to locate the actual ammount under the same column I am totalling as this
becomes a circular reference. Consequently, I shifted it down under a
previous column. I have included a sample data and my current macro below.
How do I shift this back under the desired column (D)? Any ideas? Or is
there a way to Sum it and keep it under the D column in the first place?

Thanks! This Forum is great!

Rick

Sample Data
01 150080380549 0000718651 000000002080
01 150080380549 0000718652 000000002912
02 150080380549 0000001219
0337311847

Current Code:

ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Select
ActiveCell.Value = "02"
ActiveCell.Offset(0, 1) = "150080380549"
ActiveCell.Offset(0, 2).Formula = "=COUNT(A:A,01)-2"
ActiveCell.Offset(3, 2).Formula = "=Sum(D:D)"



  #2   Report Post  
Niek Otten
 
Posts: n/a
Default

activecell.offset(3,2).Formula= "=sum(a1:a"&cstr(activecell.Row-1)&")"

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"Rick" wrote in message
...
I need to do a sum of a column using a macro, but having trouble trying to
determine how to place this sum at the bottom of the same column. I
cannot
to locate the actual ammount under the same column I am totalling as this
becomes a circular reference. Consequently, I shifted it down under a
previous column. I have included a sample data and my current macro
below.
How do I shift this back under the desired column (D)? Any ideas? Or is
there a way to Sum it and keep it under the D column in the first place?

Thanks! This Forum is great!

Rick

Sample Data
01 150080380549 0000718651 000000002080
01 150080380549 0000718652 000000002912
02 150080380549 0000001219
0337311847

Current Code:

ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Select
ActiveCell.Value = "02"
ActiveCell.Offset(0, 1) = "150080380549"
ActiveCell.Offset(0, 2).Formula = "=COUNT(A:A,01)-2"
ActiveCell.Offset(3, 2).Formula = "=Sum(D:D)"





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
circular error w/o cell reference Remote Todd Excel Discussion (Misc queries) 1 August 11th 05 12:49 PM
Iterate Circular Reference Brandt Excel Discussion (Misc queries) 1 August 3rd 05 11:43 PM
Chart User Template Error Bars Reference ainsliek Charts and Charting in Excel 0 July 6th 05 05:00 PM
Help solve a Circular Reference brupub Excel Worksheet Functions 6 February 14th 05 07:11 AM
Circular reference Pat Excel Discussion (Misc queries) 2 January 19th 05 05:52 AM


All times are GMT +1. The time now is 07: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"