Left string in VBA

  • Thread starter Thread starter Michael Vaughan
  • Start date Start date
M

Michael Vaughan

Hello Everyone,

What is the VBA equivalent to LEFT(A1,3) which we use in formulas so that I
can do the following:

I am trying to write some code in VBA that will kind of parse a form and
format it on a copied book. That part is all done. Then I want to insert
rows with dates that are not parsed from my document. Example.. my parsed
form looks like this:

09/04/04 text
09/05/04 text
09/06/04 text

I want to make it so that the dates from the 1st to the 4th, are created
before the ones above to look like this:

09/01/04 OFF
09/02/04 OFF
09/03/04 OFF
09/04/04 text
09/05/04 text
09/06/04 text
 
Confused. Where does LEFT(A1,3) come into it?

VBA has a LEFT function, but it works on a string( LEFT("Michael",3)), or a
string variable (LEFT(myVar,3)), or even a cell reference.
(LEFT(Range("A1").Value,3))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top