# Convert Fraction From ComboBox To Decimal In TextBox

Dec 16, 2007

i have a combo boxes populated with fractions 1/16, 1/8, 3/16, 1/4 etc up to 15/16.

i just want to output the chosen fraction to a textbox as a decimal.

This is done in a userform, not in a cell.

## Convert Fractions To Decimals And Decimal To Fraction

Feb 6, 2009

I know that if I enter =3/4 in a cell it will give me .75 but is there is formula to convert fractions into decimals or is this the best way to do it? I was also wondering if there is some way to convert the decimal amount to a fraction

for measurement conversions I know that
=B3*25.4 will convert a decimal to mm and so will the formula =CONVERT(E4,"in","mm")

and to convert mm to a decimal a few formula that work are
=CONVERT(H3,"mm","in")
=MROUND(H4/25.4, 1/8)
=H5/25.4
=INT(H6/25.39999918*8)/8

But is there a way to convert a fraction to the decimal and is there a way to convert mm to a fraction instead of the decimal equivalent of the fraction?
or maybe a formula to convert mm to inches but instead of the result being in decimal format it would be in fraction format?

## Decimal To Fraction (Inches)

Oct 28, 2008

Could someone please tell me what is wrong with this formula. I have been looking at it for so long, I can't even concentrate .....

## Fraction Is Appearing As Decimal

Apr 13, 2007

I am joining two columns of data. first col. has size in fraction format: 7 3/8

second column has text string:

HABITAT CINCY POD HAT ERA BLK/RD

Concatenate= HABITAT CINCY POD HAT ERA BLK/RD 7.375

Changing fraction to decimal, needs to remain fraction.

I have played w/ the formatting to make Number w/ zero decimal places and then selected Fraction, but no luck there.

## Inches And Decimal Fraction

Jun 23, 2008

I am working on a simple calculater, what I want to do is figure sq. inches my problem is every thing I try the decimals won't calculate right,, this is a example of what I want to do

8.25x10.75= 81 sq"

## Formula To Convert Fraction Of Year To Months?

Jan 28, 2012

Inmates can apply for pre-release when they have half their minimum sentence served. For example 2 years 6 months. They would have to serve 1 year 3 months.

I use this formula

=DATE(YEAR(A1)-A5,MONTH(A1)-B5,DAY(A1)-B6)

Where A1 is half the years, B5 is half the months, and B6 is half the days. The problem is when an inmate is sentenced to a minimum of 3 years and 3 months. The latter formula will not calculate 1.5 years or 1.5 months. It rounds up. What I would like to do is covert the 1.5 years to months and the 1.5 months to days.

## Convert Or Format Decimal To X Digits Without Decimal Point

Aug 8, 2008

I am trying to create a unique sample code by putting together the values of other cells that a user will input. It's all working well apart from the last part, where I am trying to include a decimal number. I want the decimal number to appear without the central "." and in a four digit format. e.g. 2.5 would appear as 0250, 14.25 would appear as 1425. This is the formlua I am using currently:

=IF(ISBLANK(B4),"",IF(LEFT(C4,1)="w",(B4&"-"&TEXT(F4,"YYMMDD")&C4&TEXT(G4,"HHMM")),(B4&"-"&TEXT(F4,"YYMMDD")&C4&LEFT(TEXT(H4,"00"),2)&RIGHT(TEXT(H4,"00"),2))))

However, where the value of H4 is 2.5, I am getting a result of 0303 (I've put this part in bold). I have attached a small spreadsheet to aid understanding.

## ComboBox Selection That Fills A TextBox And Other ComboBox

Sep 28, 2013

I created a UserForm then linked ComboBox1 to range A2:A, TextBox2 to range E2:E, and ComboBox3 to range M2:M of the same worksheet, named Sheet3. The row contents in Column A, Column E, and Column M are associated. Therefore, when the UserForm is active I want to be able to select a row from Column A in ComboBox1 and have the UserForm pull the contents from the same row of Column E into TextBox2, and Column M into ComboBox3. Here is what I have so far, but its not quite doing it.

Code:
Private Sub UserForm_Initialize()
Sheets("Sheet3").Activate
Dim ColARange As Range

[Code].....

## Convert Decimal Value To DD Hh:mm:ss

Aug 22, 2014

i try to convert several decimal values into Days Hours:Minutes:Seconds my problem is the following. If i user the format DD hh:mm:ss values over 32 will start counting the days from 0 (like a new month). and if i format it like M D h:m:s values < 32 days gets displayed with a 1 (for the month) before the days.

[Code] ......

is there a way to get only the count of days displayed without the summarization to months?

## Convert [s] To Decimal

May 31, 2006

I'm trying to find out how many 40 hour shifts we had in a week by dividing the total seconds staffed (2989957) by total seconds in a week (144000) to get a 2 digit decimal result. I have a field formatted as [s] that I need to convert to decimal but when I do a calculation using that field it comes out as [s}.

Cell A1: 2989957 formatted as [s]
Cell B2: =A1/144000 formatted as number with 2 decimals
Result shows 0.00

If I use that calculation in a cell with a general format, I get 21 and it reverts to [s] format.

## Validate TextBox For Decimal Numbers

Jun 6, 2008

I have set up a form which requires one textbox to have a decimal followed by four numbers (ex .5780) and another which requires two numbers, a decimal, then two more numbers (ex 57.80). how this can be accomplished? I am new to Visual Basic coding!

## Decimal Places To Be Affected By Combobox Selection

May 12, 2013

I have a combo box where the selected abbreviation will affect the number of decimal places in another cell where figures are manually entered. The decimal places will range from 0 to 5.

The combobox contains abbreviations of product codes i.e TM, FGGT, etc up to 40+ & the range of value can vary from 4 digits to possibly 10.

So what I am looking for is if I select TM another four columns require digits to be manually input with 2 decimal places, however, if I select FGGT the same columns in a different row will need to be 4 decimal places as per the product code selection from the combobox.

e.g TM = 2 decimals
FGGT = 4 decimals,

## Convert 1/2-20 3a Fractions Into Decimal

Jun 24, 2009

I need to convert the fraction at the beginning of a cells text into the decimal equivelent. for example 1/4-20 3A would give .2500. I have this formula so far that works perfect for fractions that only contain 1 number on each side of the division sign such as 1/2.

## Convert Decimal To Percentage

Jul 8, 2009

Is there a method to automatically convert a decimal to a percentage?

For example:

if given the value of 76.48, is it possible to automatically convert this to 76.48%? Formatting the cell as a percentage produces 7648%. I've tried everything I know and can't get the right result.

## Convert Time To Decimal

Jun 12, 2009

I am trying to convert time (formated as hh:mm) to a number with 2 decimal places.

Example

A1 7:51
B1 - want the number to show 7.85

Will then multiply this by an hourly wage to get total \$ paid.

## Convert Number To Decimal

Sep 4, 2009

I need a formula to take the numbers listed in cells D4:D50

If below 1,000,000 than just keep that number value

EXAMPLE DATA

If the Ten Thousands place is 5 or below leave the same if it is higher round up. (use this concept for ALL PLACE VALUES

1,500,000 to 1.5 million (if the rest are zeros)

4,000,000 to 4 million

1,564,535 than to 1.57 million

1,545,535 than to 1.54 million

1,555,000 than to 1.55 million

Same concept for the rest as the Millions (move the rounded place up as needed)

So for Billions it would be 10 Millions place (to round form) I think lol

1,000,000,000 to 1 Billion

1,500,000,000 to 1.5 Billion

1,560,000,000 to 1.57 Billion

1,578,000,000 to 1.58 Billion

1,700,000,000 to 1.7 Billion

I would like this to continue all the way up to place value 999 QUADILLION! (if possible) if the value can go bigger that would be great!

## Convert Decimal To 13 Bit Binary

Aug 11, 2008

I was reading this Binary Conversion from Decimal on this site, however i am unable to reply to the thread. This code is exactly what i was looking for but have the need for it to be able to give the result as a number of bits eg. i would like the result to be dispalyed as 13 bits. I have tried modifying the code without any success and would like to be able to use it in this form. Public Function Dec2Base( Num As Long, base As Long, length as long) As String

## VBA / Formatting Textbox To Number With 3 Decimal Places

Nov 21, 2012

I need to have textBox2. formatted to a number with 3 decimal places.

The code below is executed from the command button.

Code:
Private Sub CommandButton1_Click()
If IsNumeric(Me.TextBox1.Value) Then
Me.TextBox2.Value = Me.TextBox1.Value / 25.4
End If
End Sub

I found the code below but I cannot seem to figure it out

Code:
Private Sub TextBox2_Change()
TextBox2.Text = Format(Number, "0.000")
End Sub

## UserForm - Format Textbox For Percentage Vs Decimal?

Dec 20, 2012

I have the following code

Code:
Private Sub ComboBox1_Change()
TextBox1.Text = Range("P" & UserForm1.ComboBox1.ListIndex + 3).Value
TextBox2.Text = Range("N" & UserForm1.ComboBox1.ListIndex + 3).Value[code].....

In TextBox3, the user will input a percentage as a whole number, IE: 5 for 5%, but when the update is made, it is writing the "5" as 500% and is writing 50 as 5000%.

If there is already a percent in the cell it calls up IE: 50%, it shows up in TextBox3 as .5%

## Restrict Textbox Entry To 1 Decimal Place

Dec 2, 2006

How can I restrict entry into a textbox to 1 decimal place?

## Limit Decimal Outputs In A Userform Textbox

May 7, 2007

I have a textbox on a userform.

The textbox is populated with a number which is generated by a formula which is
the result of a "Select Case" module.

On some occasions, for instance when dividing 1000 by 3, I get a result with recurring decimals in this case 33.333333333.

Is it possible to make the "result" round to the nearest whole number?
The textbox is named "inDorW".

## Restrict TextBox Entries To X Decimal Places

Oct 12, 2007

I have following for change event in text boxes to only allow numerics e.g.

Private Sub txtGBP10_Change()
If (Not IsNumeric(txtGBP10.Value) And (txtGBP10.Value <> "")) Then
txtGBP10.Value = Left(txtGBP10.Value, Len(txtGBP10.Value) - 1)
End If
End Sub
Private Sub txtShare10_Change()
If (Not IsNumeric(txtShare10.Value) And (txtShare10.Value <> "")) Then
txtShare10.Value = Left(txtShare10.Value, Len(txtShare10.Value) - 1)
End If
End Sub

Can I add some code so that the user can only add numeric entries to 2 DP (txtGBP) or 3DP(txtShare)

## Force Decimal In Place Of Comma In TextBox

Jan 18, 2008

I have an UserForm, where I have several text boxes. One of these textboxes should be entered with decimals. I have been able to cope with the declarations, and set the variable as Variant. However, is it possible to prevent the user inserting "," instead of "."? Alternatively, automatically change "," to "."?

## Convert Decimal To 00:00:00 Time Format

Apr 9, 2014

How to be able to convert decimal hours into time format.

Here are the examples:

12.2 = 12:02:00
98.41 = 98:41:00
300.42.1 = 300:42:10

and so on and so forth...

## Text To Columns And Convert Them To Decimal

Sep 2, 2009

I got following Hex data in text format, I need change them to decimal,

0324 00BF 0000 0000 030C 00C6 0000 0000
0305 00C7 0000 0000 02FE 300F 040B 4753
4D4D 5352 4E4D 5343 4E31 0030 0F0A 0101

firstly I did txt to columns, then I found some data changed to scientific format which is not I wanted as I could not convert it using function HEX2DEC.

032400BF00000000030C00C600000000
030500C70000000002FE300F040B4753
4D4D53524E4D53434.00E+3100300F0A0101

if I set column data format to text when I doing Text to Columns operation then all data will be text, so I still can not convert them to decimal.

## Convert Feet/inches To Decimal

Feb 16, 2006

Is there a way to convert a value in a cell that is 2'-3 1/2" to adecimal such as 27.5"?

excel 2003 SP2

## Convert Decimal Value Into Total Seconds

Jan 24, 2010

I have a formula that reads like this

=((11.4)-0.000000000946727*(11.4)*((5000)*5000))

The formula is used to calculate a comparative run time at an elevation of 5000 feet. The time the run was in is 11 minutes and 40 seconds. What I need to do is convert the 11.40 into total seconds which would be 700.

Now the actual 11.4 in the forumala is from a cell reference (say D14). It's whatever time the member plugs in (and so is the 5000, this represents the members altitude).

I need the time to stay in a decimal format because I have a huge database that I perform a lookup on to find the point value for it for another calculation seperate from this one. If I were to plug 700 in place of 11.4 my calculated result would be 683.43 which is exactly what I need.

## Convert Minutes Into Decimal Hours

Aug 29, 2007

How to I convert minutes into the equivalent fractional hours?

## Convert Decimal Time To Hundredths

Aug 29, 2007

Have a large spreadsheet with time posted in minutes, but is formatted as "general" not time. (ie 8.15 is the entry in general format. Needs to be 8.25 to pay employee correctly). What formula can I use to convert that 8.15 to 8.25 easily?

## Convert Binary Info In A Column To Decimal?

Mar 17, 2014

I am trying to convert 14 to 15 digits lengthy Binary value to number.

The formula =BIN2DEC(A2) is giving error #NUM

101111100001010
101111100001010
101111100001010
101111000011100
101111000011100
101111000011100
110001000001010