rnordquest
New member
I want to reverse the order of each section and tried this. What did I do wrong?
' Reorder each section
Range("B4").Select
npts = ActiveCell.Value
Do Until npts < 1
ActiveCell.Offset(1, -1).Activate
sRow = ActiveCell.Row
For n = 1 To npts
x = ActiveCell.Value
ActiveCell.Offset(0, 1).Activate
y = ActiveCell.Value
ActiveCell.Offset(0, 1).Activate
z = ActiveCell.Value
Next n
Cells(sRow, 1).Select
For n = npts To 1 Step -1
x = ActiveCell.Value
ActiveCell.Offset(0, 1).Activate
y = ActiveCell.Value
ActiveCell.Offset(0, 1).Activate
z = ActiveCell.Value
Next n
ActiveCell.Offset(4, 1).Activate
npts = ActiveCell.Value
Loop
I get an error on the first x line for end of statement. Will the check for npts<1 be met when I run out of data at the bottom?
Thanks,
Roger
' Reorder each section
Range("B4").Select
npts = ActiveCell.Value
Do Until npts < 1
ActiveCell.Offset(1, -1).Activate
sRow = ActiveCell.Row
For n = 1 To npts
x = ActiveCell.Value
ActiveCell.Offset(0, 1).Activate
y = ActiveCell.Value
ActiveCell.Offset(0, 1).Activate
z = ActiveCell.Value
Next n
Cells(sRow, 1).Select
For n = npts To 1 Step -1
x = ActiveCell.Value
ActiveCell.Offset(0, 1).Activate
y = ActiveCell.Value
ActiveCell.Offset(0, 1).Activate
z = ActiveCell.Value
Next n
ActiveCell.Offset(4, 1).Activate
npts = ActiveCell.Value
Loop
I get an error on the first x line for end of statement. Will the check for npts<1 be met when I run out of data at the bottom?
Thanks,
Roger