Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Test String | Excel Discussion (Misc queries) | |||
test if a character in a string is alpha | Excel Programming | |||
How to test text string to know if it is a date | Excel Programming | |||
Test for exact match in string | Excel Programming | |||
Test a String to see if it begins with a Number | Excel Programming |