Dear Richard, I would like to define a variable that refers to the first 3 characters of a specific cell. Example: If the cell data is "January", the variable should be equal to "Jan" I have the following chunk of code. How can I finish it/correct it?
Dim month as Character month=Workbooks("Book1.xls").Worksheets("Sheet1").Range("B3")
Thank you very much in advance. Cheers Marta Answer from Richard Rost:
If you want to look at a cell that contains "January" and want to return the first three characters "Jan" then just use the LEFT function:
=LEFT(A1,3)
It will also work in your VBA code too.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Visual Basic Forum.