I have around 200 rows of data with 2 empty rows separating each group. I would like to insert a specific value into the upper most row for each group in column 'B'.
Here is my code I am trying to get to work. As of now it is giving me 2 values for each group. Hope this makes since.
Private Sub CommandButton1_Click()
Dim LastRow As Long, x As Long
With Sheets("All Loans")
LastRow = 3
For x = .Range("B65536").End(xlUp).Row To LastRow Step -1
If .Range("B" & x) <> .Range("B" & x - 1) Then _
Cells(x, "B").Value = "Totals:" & Cells(x, "B").Value
Next x
End With
End Sub
Here is my code I am trying to get to work. As of now it is giving me 2 values for each group. Hope this makes since.
Private Sub CommandButton1_Click()
Dim LastRow As Long, x As Long
With Sheets("All Loans")
LastRow = 3
For x = .Range("B65536").End(xlUp).Row To LastRow Step -1
If .Range("B" & x) <> .Range("B" & x - 1) Then _
Cells(x, "B").Value = "Totals:" & Cells(x, "B").Value
Next x
End With
End Sub