View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLatham JLatham is offline
external usenet poster
 
Posts: 3,365
Default Need help with a vb function

If you're looking at text in a cell (G9 for example's sake)

If Left(Range("G9",1)="A" Then
Range("G9")=Range("G9") & "X"
End if
note that in VB, "A" is not the same as "a".

If you have the text in a variable, as myText, then:
If Left(myText,1)="A" Then
myText=myText & "X"
End if


" wrote:

I am a newbie at writing macros for excel, so bare with me. I need to
write a macro that looks for a character at the beginning of a line.
If the a certain character exists, lets say capital A, I need to go to
the end of the line and insert another character before the carriage
return.