Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing fractions

Status
Not open for further replies.

jaredgalen

Programmer
May 28, 2003
34
LT
I'm importing a text file that has fractions, 1/2000.
When they get imported it chages them to dates and screws eveything up.
I tried selecting, in the import wizard, text instead of general but it keeps changing it. I can't figure it out.
Please help, I'm at my wits end....

jG
 
This is a very difficult issue and I don't think there is a general solution as differing orders of denominator need different action.

The following code can be run on selected cells as a macro and will convert to fraction format but it may not be the fraction you expect.

Sub ConvertFractions()
Dim cell as range
For Each cell In Selection
cell.Value = Evaluate("=" & cell.Value)
cell.NumberFormat = "# ????/????"
Next cell
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top