Obtaining the first seven characters of a text cell

  • Thread starter Thread starter Michael McClellan
  • Start date Start date
M

Michael McClellan

I am trying to obtain the first seven characters of text in a given cell
in excel using VBA.

i.e. - a cell contains the text HMA4178A. I want to pass the HMA4178 to
a variable in VBA to be used with the dir statement.

Does anyone have any idea?


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
strResult =Left(Cell reference or Text String, 7) would do
the trick!

Martin
-----Original Message-----
Hi, try using this function
=Right([Cell Reference or Text String],7)

-----Original Message-----

I am trying to obtain the first seven characters of text in a given cell
in excel using VBA.

i.e. - a cell contains the text HMA4178A. I want to pass the HMA4178 to
a variable in VBA to be used with the dir statement.

Does anyone have any idea?


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
.
.
 
Back
Top