Bill_Biggs
Well-known Member
- Joined
- Feb 6, 2007
- Messages
- 1,216
I have written the following code to subdivide data on a page by changes in column A and count those subdivisions. Just wondering if there is a better way to do this.
'Now seperate the data by the CPU's
Range("A1").Select
E = Range("A1").Value
DeltaAlpha:
ActiveCell.Offset(1, 0).Select
F = ActiveCell.Value
If F = "" Then GoTo DeltaBeta
If E = F Then GoTo DeltaAlpha
If E <> F Then
ActiveCell.EntireRow.Insert Shift:=xlDown
G = G + 1 'Counts the number of times that DeltaAlpha subdivides the data
End If
ActiveCell.Offset(1, 0).Select
E = ActiveCell.Value
GoTo DeltaAlpha
DeltaBeta:
End Sub
Thanks ahead of time.
Bill
'Now seperate the data by the CPU's
Range("A1").Select
E = Range("A1").Value
DeltaAlpha:
ActiveCell.Offset(1, 0).Select
F = ActiveCell.Value
If F = "" Then GoTo DeltaBeta
If E = F Then GoTo DeltaAlpha
If E <> F Then
ActiveCell.EntireRow.Insert Shift:=xlDown
G = G + 1 'Counts the number of times that DeltaAlpha subdivides the data
End If
ActiveCell.Offset(1, 0).Select
E = ActiveCell.Value
GoTo DeltaAlpha
DeltaBeta:
End Sub
Thanks ahead of time.
Bill