Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine data type in a string
Could someone please tell me how to determine the data type of each char of
a string? I have worksheets named 'October07'. I need to extract just the month name first and then the year number. I would like to loop thru the string until I find an integer character. Thanks, M. Miller |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine data type in a string
=LEFT(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123 456789"))-1)
-- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "news.epix.net" wrote in message ... Could someone please tell me how to determine the data type of each char of a string? I have worksheets named 'October07'. I need to extract just the month name first and then the year number. I would like to loop thru the string until I find an integer character. Thanks, M. Miller |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine data type in a string
You can use isnumeric.
dim lCtr as long dim myWord as string dim myStr as string myWord = "October07" myStr = "" for lctr = 1 to len(myword) if isnumeric(mid(myword, lctr, 1)) then 'get out, we're done exit for else myStr = mystr & mid(myword, lctr, 1) end if next lctr msgbox mystr (Watch for typos!) "news.epix.net" wrote: Could someone please tell me how to determine the data type of each char of a string? I have worksheets named 'October07'. I need to extract just the month name first and then the year number. I would like to loop thru the string until I find an integer character. Thanks, M. Miller -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine data type in a string
Use the =ISNUMERIC() function
-- Gary''s Student - gsnu200752 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine data type in a string
Missed year number
=MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"01234 56789")),99) -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Bob Phillips" wrote in message ... =LEFT(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123 456789"))-1) -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "news.epix.net" wrote in message ... Could someone please tell me how to determine the data type of each char of a string? I have worksheets named 'October07'. I need to extract just the month name first and then the year number. I would like to loop thru the string until I find an integer character. Thanks, M. Miller |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine data type in a string
On Wed, 31 Oct 2007 08:53:26 -0400, "news.epix.net" wrote:
Could someone please tell me how to determine the data type of each char of a string? I have worksheets named 'October07'. I need to extract just the month name first and then the year number. I would like to loop thru the string until I find an integer character. Thanks, M. Miller If your worksheets are all named with the last two characters being numeric, then Month = left(ws.name,len(ws.name)-2) Year = right(ws.name,2) + 2000 --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
find string data type related functions | Excel Programming | |||
Determine file type | Excel Programming | |||
Can I determine the active selection's type? | Excel Programming | |||
Determine data type for Pivot Field | Excel Programming | |||
Determine File Type | Excel Programming |