I have the following macro to change a part of a cell if a value is found.
i.e cell value (Help) maybe either of the following 3 examples
Help, help, HELP
Remember there is also text before and after the help value i.e.
123Helpabc
My question is, can someone help with an abbreviated script so that it cuts it down and therefore when I change the script in the future it is easier.
The script I currently use is
i.e cell value (Help) maybe either of the following 3 examples
Help, help, HELP
Remember there is also text before and after the help value i.e.
123Helpabc
My question is, can someone help with an abbreviated script so that it cuts it down and therefore when I change the script in the future it is easier.
The script I currently use is
Code:
Sub test3()
Range(Cells(Rows.Count, "A").End(xlUp), Cells(2, "A")).Select
For Each Cell In Selection
If InStr(Cell.Value, "HELP") > 0 Then
Cell.Value = Mid(Cell.Value, InStr(Cell.Value, "HELP"), 4)
Else
If InStr(Cell.Value, "Help") > 0 Then
Cell.Value = Mid(Cell.Value, InStr(Cell.Value, "Help"), 4)
Else
If InStr(Cell.Value, "help") > 0 Then
Cell.Value = Mid(Cell.Value, InStr(Cell.Value, "help"), 4)
End If
End If
End If
Next Cell
End Sub