Melrose0507
New Member
- Joined
- Jul 19, 2011
- Messages
- 22
I am having issues with how to end my macro. I want to cut the cell in column H if it equals "TXT" and then insert it 5 rows to the right. Below is my macro. The error I receive is "End With without With". Some one please help guide me!!!
Private Sub TXT()
Dim LR As Long, i As Long
LR = Range("H" & Rows.Count).End(xlUp).Row
For i = LR To 2 Step -1
With Range("H" & i)
If Cells(i, "H").Value = "TXT" Then
Selection.Cut
ActiveCells.Offset(0, 5).Insert
End With
Next i
End Sub
Private Sub TXT()
Dim LR As Long, i As Long
LR = Range("H" & Rows.Count).End(xlUp).Row
For i = LR To 2 Step -1
With Range("H" & i)
If Cells(i, "H").Value = "TXT" Then
Selection.Cut
ActiveCells.Offset(0, 5).Insert
End With
Next i
End Sub