strangebiscuit
New Member
- Joined
- Nov 25, 2013
- Messages
- 35
I'm working on a macro that does two things. First, it will split data into multiple sheets (with each sheet based on the value of a specific column). Second, it will loop through all the sheets and add certain sums and formulas to the bottom of each sheet.
I found a very helpful bit of code to split the sheets which I modified slightly and works fine. And I found another bit of code that will cycle through all the sheets in the document. I'm just not sure how to add the necessary sums/formula fields to the end of each sheet.
The code to loop through the sheets is this:
So in the "insert your code here" part I need code that:
And I think I can figure out the rest if I get that far.
Any help or advice would be greatly appreciated. Thanks very much!
I found a very helpful bit of code to split the sheets which I modified slightly and works fine. And I found another bit of code that will cycle through all the sheets in the document. I'm just not sure how to add the necessary sums/formula fields to the end of each sheet.
The code to loop through the sheets is this:
Code:
Sub WorksheetLoop2()
' Declare Current as a worksheet object variable.
Dim Current As Worksheet
' Loop through all of the worksheets in the active workbook.
For Each Current In Worksheets
' Insert your code here.
' This line displays the worksheet name in a message box.
MsgBox Current.Name
Next
End Sub
So in the "insert your code here" part I need code that:
- Finds the last row of data on the sheet
- Go down one or two rows from there
- In column A of that row add a label that just says "Total Points"
- In column B of that row make a cell that sums the total of all the values in column H (which are simple integers)
- On the next row of column A add a label that says "Overrides"
- On that same row in column B leave a blank space where user can put in their own number.
- On the next row of column A add a label that says "Total"
- On that same row in column B make the cell give the sum of the Total Points and Overrides cells that were just added directly above.
And I think I can figure out the rest if I get that far.
Any help or advice would be greatly appreciated. Thanks very much!
Last edited: