Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default 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.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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.






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default 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.








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
parsing on a date string pulled from a database. Zone99 Excel Discussion (Misc queries) 3 July 9th 07 11:49 PM
Parsing when deliminator is a string Rose Excel Worksheet Functions 5 December 14th 04 12:54 AM
Parsing a String to get Numbers nabukhalaf[_2_] Excel Programming 4 October 6th 04 12:05 AM
Parsing a string to retrieve numerals nabukhalaf Excel Programming 2 October 5th 04 10:23 PM
Unicode string parsing? Please help! Douglas Gennetten[_2_] Excel Programming 1 January 16th 04 08:31 AM


All times are GMT +1. The time now is 09:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"