Sub chuckles1066()
Dim lr As Long
Dim a As Long
Dim b As Long
lr = Range("A" & Rows.Count).End(xlUp).Row
b = 2
For a = 2 To lr
Select Case Cells(a, 1).Value
Case -1
Cells(b, 3).Value = Cells(a, 1).Value
Cells(b, 4).Value = a
b = b + 1
End Select
Next
End Sub
Try this...need a formula to drag down
Book1 | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | Data | _ | Number | Row | ||
2 | -1 | _ | -1 | 2 | ||
3 | 1 | _ | Count | 6 | ||
4 | -6 | _ | 5 | 8 | ||
5 | 5 | _ | _ | 12 | ||
6 | -1 | _ | _ | 14 | ||
7 | 1 | _ | _ | |||
8 | -1 | _ | _ | |||
9 | 4 | _ | _ | |||
10 | -2 | _ | _ | |||
11 | 1 | _ | _ | |||
12 | -1 | _ | _ | |||
13 | 1 | _ | _ | |||
14 | -1 | _ | _ | |||
Sheet1 |