ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   parsing a string (https://www.excelbanter.com/excel-programming/328367-parsing-string.html)

Mark[_57_]

parsing a string
 
i'm writing a macro from within excel 2003. if i have a string with value
"abc", how do i select just "ab".

i tried the left(string,number) function (which i use in VB all the time)
but i guess within excel that doesnt' work?

thanks.



JulieD

parsing a string
 
Hi Mark

umm, left should work .. check out the following


Sub teststring()
mystr = "abc"
MsgBox Left(mystr, 2)
End Sub

if you can't get it to work, post your code and we'll have a look.

--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
....well i'm working on it anyway
"Mark" wrote in message
...
i'm writing a macro from within excel 2003. if i have a string with value
"abc", how do i select just "ab".

i tried the left(string,number) function (which i use in VB all the time)
but i guess within excel that doesnt' work?

thanks.





Mark[_57_]

parsing a string
 
you're correct..it does work.. i'm brain dead this morning..
sorry for wasting your time. (my error was related to something else)
thx.


"JulieD" wrote in message
...
Hi Mark

umm, left should work .. check out the following


Sub teststring()
mystr = "abc"
MsgBox Left(mystr, 2)
End Sub

if you can't get it to work, post your code and we'll have a look.

--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
...well i'm working on it anyway
"Mark" wrote in message
...
i'm writing a macro from within excel 2003. if i have a string with

value
"abc", how do i select just "ab".

i tried the left(string,number) function (which i use in VB all the

time)
but i guess within excel that doesnt' work?

thanks.







Tom Ogilvy

parsing a string
 
As JulieD said, it works in VBA. However, this is often the command you
will get an error on if you have bad references in Tools=References. Look
there after the error and see if you have one or more references marked as
MISSING. If you do, you need to fix these references.

References shown in Tools=References in the VBE are relative to the Active
Project. Make sure (look in the project explorer window) that your workbook
is the Active Project (selected in the project explorer window).

--
Regards,
Tom Ogilvy

"Mark" wrote in message
...
i'm writing a macro from within excel 2003. if i have a string with value
"abc", how do i select just "ab".

i tried the left(string,number) function (which i use in VB all the time)
but i guess within excel that doesnt' work?

thanks.





JulieD

parsing a string
 
no probs .. all have days like that :)

--
Cheers
JulieD

"Mark" wrote in message
...
you're correct..it does work.. i'm brain dead this morning..
sorry for wasting your time. (my error was related to something else)
thx.


"JulieD" wrote in message
...
Hi Mark

umm, left should work .. check out the following


Sub teststring()
mystr = "abc"
MsgBox Left(mystr, 2)
End Sub

if you can't get it to work, post your code and we'll have a look.

--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
...well i'm working on it anyway
"Mark" wrote in message
...
i'm writing a macro from within excel 2003. if i have a string with

value
"abc", how do i select just "ab".

i tried the left(string,number) function (which i use in VB all the

time)
but i guess within excel that doesnt' work?

thanks.










All times are GMT +1. The time now is 01:46 PM.

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