This macro works, but I would like adapted in two ways:
1) Instead of hard coded d1:d1000, I would like to use selected cells
2) I would like to be asked for the character to use instead of the hard coded "m".
Sub RemoveAfter()
For Each c In Range("d1:d1000")
If InStr(c.Value, "m") > 0 Then
c.Value = Left(c.Value, InStr(c.Value, "m") - 1)
End If
If InStr(c.Value, "m") > 0 Then
c.Value = Left(c.Value, InStr(c.Value, "m") - 1)
End If
Next c
End Sub
1) Instead of hard coded d1:d1000, I would like to use selected cells
2) I would like to be asked for the character to use instead of the hard coded "m".
Sub RemoveAfter()
For Each c In Range("d1:d1000")
If InStr(c.Value, "m") > 0 Then
c.Value = Left(c.Value, InStr(c.Value, "m") - 1)
End If
If InStr(c.Value, "m") > 0 Then
c.Value = Left(c.Value, InStr(c.Value, "m") - 1)
End If
Next c
End Sub