Quote Originally Posted by sharik View Post
guys,
he is new at programing and your "throwing" all this code.... im sure he wants it simple
ofcourse that "simple" depends on preseption
in any case, here is simple (yet primitive) way for you...

mainstring :04072009

the input is a string , which means you can access each char (cell) individually
so...if you want to get the "4" then you can write mainstring(2) , cell number 2.

as for your example :
startMonth = mainstring(1) & mainstring(2)
startDay = mainstring(3) & mainstring(4)
startYear = mainstring(5) & mainstring(6) & mainstring(7) & mainstring(8)

by the way, & is appending (adding) to the end of the string
for someone criticizing what other people are posting, did you even try this code you are tying here? I can only imagine that you did not, since arrays start at index 0, meaning your startMonth variable will have a value of "40" not "04" based on the code you are showing there. There is no char at index 8 in a 8 character string, its 0-7, so the code would crash on the startYear assignment line.