View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jake Marx[_3_] Jake Marx[_3_] is offline
external usenet poster
 
Posts: 860
Default Left three text characters

Hi Mike,

It's very similar to the worksheet function:

myMonth = Left$(Sheets("Sheet1").Range("G3").Value, 3)

You may want to use .Text instead of .Value, depending on what is actually
stored in the cell - the Text property returns the text displayed to the
user, while the Value property returns the actual value of the cell.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Mike wrote:
I have a variable called "myMonth". I would like this
variable to be set to the first three text characters in
cell "G3".

For instance, if G3 is January, I'd like for myMonth to
equal "Jan"

I know that in Excel, I would have the formula be =left
(D3,3). How do I put this into VB code?

Thanks,
Mike.