M
mary
Thanks both KEN and TOM. Both macros worked, except the
first total set of totals is at the 4th and every other
sets are after the 5th. Any idea why? The first set is
not the 5th occurrence of total?
You guys are perfect, I have to say it. Without you
guys, me and my friend Mary would not have been able to
do anything with this project. Tom? Any idea on any
resources that could help us? I love this macro thing,
but i cannot figure it out. TOM i am planning to call
that macro you gave my friend yesterday once this macro
has added total1 and soon.
But my problem now is how would the macro's formula
knows the range for total2, total3 and soon without
including value for total1 in total2.or include total1,
total2 for total3? I added some range for testing but
these are not the range that I will be looking for.. I
only want the total for items C1:TOTAL1 and E1:TOTAL1.
And total2 to start from total1 and whatever range C AND
E to the end of total2. And total3 to start from total3
to the end of total3. This is the macro you gave me
earlier TOM. Is it possible to make reference to total1
even though the values to calculate will be coming from C
AND E.? Is it possible to make reference to total1 for
the first calculation for range C AND E.? And for total2
only all rows after total1? BASICALLY COLUMN C AND E are
the column that will be use to calculate the different
totals.
Sub supervisor()
Dim rng As Range
If Not rng Is Nothing Then
rng.Offset(0, 1).Formula = _
"=SUMIF(c1:c111,""vacation"",e1:e111)"
rng.Offset(0, 1).BorderAround Weight:=xlMedium
End If
Set rng = Cells.Find("total1")
If Not rng Is Nothing Then
rng.Offset(0, 1).Formula = _
"=SUMIF(C1:c111,""total"",E1:e111)-SUMIF
(C1:c111,""lunch"",E1:e111)"
rng.Offset(0, 1).BorderAround Weight:=xlMedium
End If
first total set of totals is at the 4th and every other
sets are after the 5th. Any idea why? The first set is
not the 5th occurrence of total?
You guys are perfect, I have to say it. Without you
guys, me and my friend Mary would not have been able to
do anything with this project. Tom? Any idea on any
resources that could help us? I love this macro thing,
but i cannot figure it out. TOM i am planning to call
that macro you gave my friend yesterday once this macro
has added total1 and soon.
But my problem now is how would the macro's formula
knows the range for total2, total3 and soon without
including value for total1 in total2.or include total1,
total2 for total3? I added some range for testing but
these are not the range that I will be looking for.. I
only want the total for items C1:TOTAL1 and E1:TOTAL1.
And total2 to start from total1 and whatever range C AND
E to the end of total2. And total3 to start from total3
to the end of total3. This is the macro you gave me
earlier TOM. Is it possible to make reference to total1
even though the values to calculate will be coming from C
AND E.? Is it possible to make reference to total1 for
the first calculation for range C AND E.? And for total2
only all rows after total1? BASICALLY COLUMN C AND E are
the column that will be use to calculate the different
totals.
Sub supervisor()
Dim rng As Range
If Not rng Is Nothing Then
rng.Offset(0, 1).Formula = _
"=SUMIF(c1:c111,""vacation"",e1:e111)"
rng.Offset(0, 1).BorderAround Weight:=xlMedium
End If
Set rng = Cells.Find("total1")
If Not rng Is Nothing Then
rng.Offset(0, 1).Formula = _
"=SUMIF(C1:c111,""total"",E1:e111)-SUMIF
(C1:c111,""lunch"",E1:e111)"
rng.Offset(0, 1).BorderAround Weight:=xlMedium
End If