StevenData
New Member
- Joined
- Mar 23, 2002
- Messages
- 10
Greetings,
I am trying to convert a column of lengths in the numeric format of decimal feet (i.e. 2.1, 2.2,…2.10,12.11). how can I convert this to fractional inches(i.e. 2.08, 2.17,…,2.83,2.92). A great contributor of this forum,dk has suggested using the following macro, which beautifully works for all values except those containing the fractions .10 and .11(i.e. 2.10, 2.11). could you please help me to make dk’s macro work for all valid values.
sub convertfeetandinches()
dim cl as range
for each cl in selection.cells
if isnumeric(cl.value) then
cl.value=format(int(cl.value)+(cl.value - int(cl.value))*10/12,"#,##0.00")
end if
next
end sub
Sincerely, Steve
I am trying to convert a column of lengths in the numeric format of decimal feet (i.e. 2.1, 2.2,…2.10,12.11). how can I convert this to fractional inches(i.e. 2.08, 2.17,…,2.83,2.92). A great contributor of this forum,dk has suggested using the following macro, which beautifully works for all values except those containing the fractions .10 and .11(i.e. 2.10, 2.11). could you please help me to make dk’s macro work for all valid values.
sub convertfeetandinches()
dim cl as range
for each cl in selection.cells
if isnumeric(cl.value) then
cl.value=format(int(cl.value)+(cl.value - int(cl.value))*10/12,"#,##0.00")
end if
next
end sub
Sincerely, Steve