How would I change a5000 to last row?
Sub PosX()
Dim r As Range
Dim i As Long
Dim LastRow As Long
Set r = Range("A1:A5000")
For i = r.Rows.Count To 1 Step -1
With r.Cells(i, 1)
If .Value = "POSNX" Then
Range("A" & i + 0).Range("$h$1").FormulaR1C1 = _
"=RC[-4]"
'With ActiveWorkbook.ActiveSheet
' LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
' .Range("A11:AD" & LastRow).Select
'End With
End If
End With
Next i
End Sub
Sub PosX()
Dim r As Range
Dim i As Long
Dim LastRow As Long
Set r = Range("A1:A5000")
For i = r.Rows.Count To 1 Step -1
With r.Cells(i, 1)
If .Value = "POSNX" Then
Range("A" & i + 0).Range("$h$1").FormulaR1C1 = _
"=RC[-4]"
'With ActiveWorkbook.ActiveSheet
' LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
' .Range("A11:AD" & LastRow).Select
'End With
End If
End With
Next i
End Sub