ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Left string in VBA (https://www.excelbanter.com/excel-programming/313327-left-string-vba.html)

Michael Vaughan

Left string in VBA
 
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



Bob Phillips[_6_]

Left string in VBA
 
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))

--

HTH

RP

"Michael Vaughan" wrote in message
...
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






All times are GMT +1. The time now is 08:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com