Pivot Table Not Recognizing Numbers

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I frequently download a huge amount of data to microsoft
excel. For some reason recently, Excel has not been
recognizing this data as numeric. I try changing the
format and that doesn't help at all. The data looks fine
but when I try to sort it, it sorts it as if it were
text. When I try to create a Pivot Table, it changes
every piece of data to 1 and gives me things like "Count
of Cost" where everything = 1 instead of the actual
cost. How can I fix this? There are no spaces before or
after the data. If I click in an individual cell twice
(without doing anything else) then click out of the cell
it will align on the right instead of the left and
recognize that cell as a number. How can I make it so
that it recognizes all of my data the correct way?

Thank you for any help.

- Chris
 
Chris,

Select all your cells that need to be changed from text to numbers, and run
the macro below.

HTH,
Bernie
MS Excel MVP

Sub TransformTextToNumbers()
Dim myCell As Range
For Each myCell In Selection.SpecialCells(xlCellTypeConstants, 2)
myCell.NumberFormat = "General"
myCell.Value = myCell.Value
Next myCell
End Sub
 
Thank you very much!
-----Original Message-----
Chris,

Select all your cells that need to be changed from text to numbers, and run
the macro below.

HTH,
Bernie
MS Excel MVP

Sub TransformTextToNumbers()
Dim myCell As Range
For Each myCell In Selection.SpecialCells (xlCellTypeConstants, 2)
myCell.NumberFormat = "General"
myCell.Value = myCell.Value
Next myCell
End Sub





.
 
Back
Top