Checking characters using VBA

  • Thread starter Thread starter Gary
  • Start date Start date
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
 
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
 
Back
Top