I have a database with a few columns that store height data in the following format...
8 ft 4 in
5 ft 1 in
8 ft 6 in
12 ft 0 in
and so forth, for a total of more than 20,000 records spread across three columns. I need to do this conversion to decimal feet using either a VBA module or an excel formula. I don't know where I'm going wrong, but I've modified another VBA script I used to convert coordinates specified in degrees minutes seconds to decimal degrees
Function ConvertFtInches(pInput As String) As Double
Dim xFt As Double
Dim xIn As Double
xFt = Val(Left(pInput, InStr(1, pInput, " ft") - 1))
xIn = Val(Mid(pInput, InStr(1, pInput, " ft") + 2, _
InStr(1, pInput, " in") - InStr(1, pInput, _
" ft") - 2)) / 12
ConvertFtInches = xFt + xIn
As a rookie with VBA, I could be completely wrong. Given that it is an adaption from another script, there is undoubtedly a problem with the script. There might be a simpler Excel formula available.
I'm hoping someone can assist. The conversions for values that are not formatted similarly to mine are included in all the other discussions.