Next obvious suggestion is that instead a text box the second input could be better a list box with predefined in, ft, m, cm, years light, etc, which answer the adequate conversion factor. So, if q1 is the out of first text box user input and u1 is the output for the second list box user input you set always q := q1*u1*meters as the total user input.
The other suggestion is the following: there are a lot of unit conversion utilities for excel scripted as vba macros. You can try to convert this into vbs. There are a lot of differences between both languages (vba = visual basic for applications, vbs = idem, but script), but with enough effort you can have sucess. This is -I think- the only way to handle inputs as "3 in" as only one string.
Regards. Alvaro.