View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
tjtjjtjt tjtjjtjt is offline
external usenet poster
 
Posts: 51
Default How do you say "begins with"

Perhaps something like this?

Sub StartingwithP()
If Left(Selection.Value, 1) = "p" Then
MsgBox "woohoo"
End If
End Sub

tj

" wrote:

Hi there,

I am writing a function that needs to have a statement in it that goes

If [data in ActiveCell] begins with "P"
then do something.

How do I do this?