Hi all,
I'm a complete beginner with VBA. Hoping for your help.
I found the below VBA, which I tested and works fine.
Sub X()
Dim lngRow As Long
Dim BotRow As Long
Cells(Rows.Count, "K").Select
Selection.End(xlUp).Select
BotRow = Selection.Row
For lngRow = 1 To BotRow
If UCase(Cells(lngRow, "K")) = "YES" Then
Cells(lngRow, "F") = Cells(lngRow, "F") & "************"
End If
Next
End Sub
After modifying to below, it no longer works.
Sub AddText()
Dim lngRow As Long
Dim BotRow As Long
Cells(Rows.Count, "N").Select
Selection.End(xlUp).Select
BotRow = Selection.Row
For lngRow = 1 To BotRow
If UCase(Cells(lngRow, "N")) = "remove" Then
Cells(lngRow, "H") = Cells(lngRow, "H") & "-Removed"
End If
Next
End Sub
Basically I want to add '-Removed' to existing cell in column H on the same row if the word 'remove' is found in cell in column N.
Any help would be much appreciated. Thanks.
I'm a complete beginner with VBA. Hoping for your help.
I found the below VBA, which I tested and works fine.
Sub X()
Dim lngRow As Long
Dim BotRow As Long
Cells(Rows.Count, "K").Select
Selection.End(xlUp).Select
BotRow = Selection.Row
For lngRow = 1 To BotRow
If UCase(Cells(lngRow, "K")) = "YES" Then
Cells(lngRow, "F") = Cells(lngRow, "F") & "************"
End If
Next
End Sub
After modifying to below, it no longer works.
Sub AddText()
Dim lngRow As Long
Dim BotRow As Long
Cells(Rows.Count, "N").Select
Selection.End(xlUp).Select
BotRow = Selection.Row
For lngRow = 1 To BotRow
If UCase(Cells(lngRow, "N")) = "remove" Then
Cells(lngRow, "H") = Cells(lngRow, "H") & "-Removed"
End If
Next
End Sub
Basically I want to add '-Removed' to existing cell in column H on the same row if the word 'remove' is found in cell in column N.
Any help would be much appreciated. Thanks.