Eric Kelcher
Board Regular
- Joined
- May 11, 2006
- Messages
- 130
I had this working in another file but would like to make it universal available macro in my Personal program.
I need the file to compare cells in col C(3) then if they are different insert a row with col C(3) saying total then perform a sum function for Col D(4) for that group.
This is the macro I have working in a stand alone program, but I am getting error with "Cells" and generally gotten myself all twisted up with all the definitions I had running in that program, I thought Cells was a macro defined term??
Could someone help either with a new way to do this or get help me with correcting my error(s)?
i = 2
While Not IsEmpty(.Cells(i, 1))
If .Cells(i, 3) <> .Cells(i - 1, 3) Then
.Cells(i, 3).EntireRow.Insert
.Cells(i, 3) = "Total"
.Cells(i, 4).Formula = "=sum(D" & FormStart & ":D" & i - 1 & ")"
I need the file to compare cells in col C(3) then if they are different insert a row with col C(3) saying total then perform a sum function for Col D(4) for that group.
This is the macro I have working in a stand alone program, but I am getting error with "Cells" and generally gotten myself all twisted up with all the definitions I had running in that program, I thought Cells was a macro defined term??
Could someone help either with a new way to do this or get help me with correcting my error(s)?
i = 2
While Not IsEmpty(.Cells(i, 1))
If .Cells(i, 3) <> .Cells(i - 1, 3) Then
.Cells(i, 3).EntireRow.Insert
.Cells(i, 3) = "Total"
.Cells(i, 4).Formula = "=sum(D" & FormStart & ":D" & i - 1 & ")"
Last edited: