Query - Formula (Test for string)
Hi,
Can someone help with the following @ all. I've created the following
VBA which works as expected the first time, however I only want it to
check for the value once, whereas this will add in the prefix more
than once when I run it?
e.g. this is meant to check B4, if this contains CD- don't do anything
if it doesn't add it in.
Any suggestions?
Cheers, Al.
Sub Prefix()
Const Prefix = "CD-"
If Left("B4", 3) = "CD-" Then
Range("B4").Select
ActiveCell.Value = Prefix & ActiveCell.Value
Else
End If
End Sub
|