markmrw
07-29-2009, 04:07 AM
Hello
it has been a while since i posted last.
a possibly easy to solve problem for you all, but it has caused me much brain ache!
i am trying to AutoSum a range using VB but the range is not always the same.
the range i want to autosum Column E and F for each customer.
any help would be greatly appreciated, and i hope i have explained myself well enough?
Sub DelPerf()
Dim Ra As Range
Set Ra = Range("b3")
Do Until Ra.Value = ""
Set Ra = Ra.Offset(1)
'MsgBox ra.Value
If Ra.Value = Ra.Offset(-1) Then
Else: Ra.EntireRow.Select
Selection.Insert Shift:=xlDown
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Ra.Offset(-1).Value = Ra.Offset(-2)
'here is where i get stuck
End If
Loop
MsgBox "end"
End Sub
it has been a while since i posted last.
a possibly easy to solve problem for you all, but it has caused me much brain ache!
i am trying to AutoSum a range using VB but the range is not always the same.
the range i want to autosum Column E and F for each customer.
any help would be greatly appreciated, and i hope i have explained myself well enough?
Sub DelPerf()
Dim Ra As Range
Set Ra = Range("b3")
Do Until Ra.Value = ""
Set Ra = Ra.Offset(1)
'MsgBox ra.Value
If Ra.Value = Ra.Offset(-1) Then
Else: Ra.EntireRow.Select
Selection.Insert Shift:=xlDown
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Ra.Offset(-1).Value = Ra.Offset(-2)
'here is where i get stuck
End If
Loop
MsgBox "end"
End Sub