Converting feet inches e g 5 ft 1 in to decimal feet using VBA or Excel

0 votes

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
'Updateby20140227
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
End Function

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.

Nov 2, 2022 in Others by Kithuzzz
• 38,000 points
585 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Others

0 votes
1 answer

Converting Textboxes Link and/or Formula to Values in a Copied Sheet using Excel VBA

Copy the values using Range and Value2 With ActiveSheet.UsedRange ...READ MORE

answered Jan 31, 2023 in Others by narikkadan
• 63,600 points
588 views
0 votes
0 answers

MS EXCEL: Convert (Height) Decimal Feet & Inches to Inches Only

Using MS Excel (2010), I would like ...READ MORE

Feb 10, 2022 in Others by Edureka
• 13,690 points
554 views
0 votes
1 answer

Excel-VBA - How to identify Target range (more than 1 cell) is deleted in a Worksheet_Change function?

You misunderstand the purpose of the function ...READ MORE

answered Sep 23, 2022 in Others by narikkadan
• 63,600 points
3,720 views
0 votes
1 answer

How to print an Excel Sheet using VBA with Nitro PDF Creator in Excel 2016

you can use the built-in excel facilities ...READ MORE

answered Sep 24, 2022 in Others by narikkadan
• 63,600 points
1,345 views
0 votes
0 answers

Convert Rows to Columns with values in Excel using custom format

1 I having a Excel sheet with 1 ...READ MORE

Feb 17, 2022 in Others by Edureka
• 13,690 points
975 views
0 votes
1 answer

Remove formulas from all worksheets in Excel using VBA

Try this : Option Explicit Sub test1() ...READ MORE

answered Oct 3, 2022 in Others by narikkadan
• 63,600 points
2,019 views
0 votes
1 answer

Calculate monthly average from daily data without PivotTable

Assuming you have the months in column D enter ...READ MORE

answered Oct 3, 2022 in Others by narikkadan
• 63,600 points
1,762 views
0 votes
1 answer

Automate compound annual growth rate (CAGR) calculation

The following PowerPivot DAX formulas worked for ...READ MORE

answered Oct 7, 2022 in Others by narikkadan
• 63,600 points
1,280 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP