Here is some code I had a while back, you should be able to make it work. How it works is you put the numerator in the text1 and denomenator in text2. This just reduces the fractions and operates on the assumtion that the whole numbers have already been extracted....example: 4/13 will work, but 32/12 will not. You would need to convert 32/12 to 2 8/12 first, then run the fraction through to reduce to lowest common denominator. You would end up with 2 2/3. Good luck.
Code:Dim text1 As Integer, text2 As Integer, i As Integer, HighDivNumber As Integer 'since we know text1 will be bigger than text2 this is how to do it 'you will need to write your own statement to make sure text1 is bigger text1.Text = text1 text2.Text = text2 For i = 1 To text2 If (text1 Mod i) = 0 And (text2 Mod i) = 0 Then HighDivNumber = i End If Next i text1 = text1 / HighDivNumber text2 = text2 / HighDivNumber 'now put these numbers in your 3rd text box




Reply With Quote