0

I have a UF calculator I'm using to provide a length measurement. I have one textbox returning the result in decimal inches, but I also have a secondary that I would like to create an "easy read" for use with a standard US measuring tape.

The number format works well in a worksheet cell, but not in this textbox. Is there a better way to go about this?

My value is 106.59375; as a worksheet function/format, the result is 106 19/32. With VBA, I'm given 1/07. I've played around with it, and it seems to be rounding value to 107, then applying the format.

UFChordCalc.TBResult.Value = Round(chordLength, 3)
With UFChordCalc.TBER
    .Value = Application.WorksheetFunction.MRound(TBResult, 1 / 32)
    .Value = Format(.Value, "# ##/##")
End With
1
  • Do you have a dot in the number - this is a decimal point ? Try 10659375 Commented Oct 27, 2022 at 13:34

1 Answer 1

1

I'd put the value in 2 string variables - first -before the decimal mark, second - after decimal mark in format "1/32" and then stick together with "&"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.