Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default How do I add rows at fixed intervals-add values after every 5 Rows

My data is in a single Column from Row 2 to 6000. I need to add the values
after every 5 Rows.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default How do I add rows at fixed intervals-add values after every 5 Rows

Hi,

You can try writing this macro. Let me know if it helps:

Sub addRows()
Dim intcount As Integer
For intcount = 7 To 7200 Step 6 ' The first formula will appear in row 7
and there will be ~1200 such formula cells. So total is 7200
ThisWorkbook.Worksheets("Sheet1").Range("A" & intcount).Select
Selection.Insert Shift:=xlDown
Selection.Formula = "=Sum(A" & intcount - 1 & ":A" & intcount - 5 &
")"
Selection.Font.Bold = True ' To distinguish the totals row in
bold
Selection.Font.ColorIndex = 3 ' To distinguish the totals row in
Red
Next intcount
End Sub


"TUKUR" wrote in message
...
My data is in a single Column from Row 2 to 6000. I need to add the values
after every 5 Rows.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How do I add rows at fixed intervals-add values after every 5 Rows

I would add another column (say A) and put this in A2:

=INT((ROW()-2)/5)
And drag down.

Then I could select my range and do
Data|Subtotals
and create a subtotal based on that column.



TUKUR wrote:

My data is in a single Column from Row 2 to 6000. I need to add the values
after every 5 Rows.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default How do I add rows at fixed intervals-add values after every 5

You are too much! More blessings for you.

"Dave Peterson" wrote:

I would add another column (say A) and put this in A2:

=INT((ROW()-2)/5)
And drag down.

Then I could select my range and do
Data|Subtotals
and create a subtotal based on that column.



TUKUR wrote:

My data is in a single Column from Row 2 to 6000. I need to add the values
after every 5 Rows.


--

Dave Peterson

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
Copy rows of data (eliminating blank rows) from fixed layout Sweepea Excel Discussion (Misc queries) 1 March 13th 07 11:05 PM
Merge data rows at fixed ratio AirBoss Excel Discussion (Misc queries) 13 December 19th 06 03:23 PM
Hiding Specific Rows Based on Values in Other Rows Chris Excel Worksheet Functions 1 November 2nd 06 08:21 PM
Extracting rows based on fixed criteria EdMac Excel Discussion (Misc queries) 6 July 6th 06 07:07 PM
fixed Rows at top of sheet [email protected] New Users to Excel 3 August 26th 05 08:55 PM


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