ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Checking characters using VBA (https://www.excelbanter.com/excel-programming/273473-checking-characters-using-vba.html)

Gary[_5_]

Checking characters using VBA
 
I would like to check the first 9 characters in a cell. If
they match then return false. For example: If a cell does
not have "includes:" as the first word then delete a
specific range. Thanks

Gary

Otto Moehrbach[_3_]

Checking characters using VBA
 
Gary
This little macro will check the active cell and clear a range if
"includes:" is not the first 9 characters. Post back if this just gets you
started and you need further help. HTH Otto
Sub CheckIncludes()
If Left(ActiveCell.Value, 9) < "includes:" Then
Range("C1:C10").ClearContents
Else
'do something else
End If
End Sub
"Gary" wrote in message
...
I would like to check the first 9 characters in a cell. If
they match then return false. For example: If a cell does
not have "includes:" as the first word then delete a
specific range. Thanks

Gary





All times are GMT +1. The time now is 05:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com