# Convert To Numeric In VBA

Jan 1, 2009I have some data fields (in yrs and days) as follows:

a = 5y020d

b = 2y225d

c = 12y003d

I need to add these three data items together in VBA to get a total yrs and days. The answer is then returned to an excel worksheet (sheet 1)

I have tried this:

a = LEFT (a, 1)

b = LEFT (b, 1)

this gives me the 5 and the 2 for the yrs but I am not sure how to get the days (20 and 225)

also, if I try and sum, i.e. a + b and then return to the spreadsheet i get 52 as the answer rather than 7 which is the answer i need. How can i convert this in the VBA correctly.