Checking characters using VBA

G

Gary

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
 
O

Otto Moehrbach

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top