Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Imported negative values

Using 2003
I have imported data with numeric negative values. I have formated the

column to numeric data. However, the value does not evaluate to
negative - ie - A5 = -10. When I select another cell and enter = A5<0
It should evaluate to TRUE however it evaluates to FALSE. If I
manually reenter the data as -10, it evaluates to TRUE.

I don't want to manually reenter all the data. How can I get Excel to
"see" this as a proper negative number?


Glen

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Imported negative values

I would guess that the cells got confused when the import happened - if
you run a macro that does the following


sub update
for each cell in range("A1:A2000")
'change the range to whatever you need
cell.value=cell.value
'looks slightly silly, but fixes the problem
next
end sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Imported negative values

Often When you import data the numbers will come through as text. Here is
some code that I use to convert text to numbers. It runs on whatever range
you have selected.

Private Sub Convert()
Dim rngCurrent As Range
Dim rngToSearch As Range

On Error Resume Next
Application.ScreenUpdating = False
Set rngToSearch = Intersect(ActiveSheet.UsedRange, Selection)
If rngToSearch Is Nothing Then Set rngToSearch = ActiveCell
If Not rngToSearch Is Nothing Then
Application.Calculation = xlCalculationManual
For Each rngCurrent In rngToSearch
If Left(rngCurrent.Value, 1) < "=" Then

If IsNumeric(rngCurrent.Value) Then
rngCurrent.NumberFormat = "0"
rngCurrent.Value = CDbl(rngCurrent.Value)
rngCurrent.Formula = rngCurrent.Value
End If
End If
Next
Application.Calculation = xlCalculationAutomatic
End If
Application.ScreenUpdating = True
End Sub


--
HTH...

Jim Thomlinson


" wrote:

Using 2003
I have imported data with numeric negative values. I have formated the

column to numeric data. However, the value does not evaluate to
negative - ie - A5 = -10. When I select another cell and enter = A5<0
It should evaluate to TRUE however it evaluates to FALSE. If I
manually reenter the data as -10, it evaluates to TRUE.

I don't want to manually reenter all the data. How can I get Excel to
"see" this as a proper negative number?


Glen


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Imported negative values

select the column

format the column as General (format=Cells=Numberformat, choose general)

then do Data=Text to Columns, select delimited and select Tab as the
delimiter.

this should cause excel to reevaluate the formula and treat them as numbers.
If that is not successful, there is a good chance you have embedded spaces
in your cells or non breaking spaces or something similar. Then you would
probably want to use a macro to clean that up.

--
Regards,
Tom Ogilvy


" wrote:

Using 2003
I have imported data with numeric negative values. I have formated the

column to numeric data. However, the value does not evaluate to
negative - ie - A5 = -10. When I select another cell and enter = A5<0
It should evaluate to TRUE however it evaluates to FALSE. If I
manually reenter the data as -10, it evaluates to TRUE.

I don't want to manually reenter all the data. How can I get Excel to
"see" this as a proper negative number?


Glen


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Values imported from one workbook to another Sri Harsha[_2_] Excel Worksheet Functions 1 April 10th 09 07:11 AM
Negative values turn into zero values Corcovadocowboy Excel Discussion (Misc queries) 4 October 4th 08 03:37 PM
how do i sum up a column of time values but ignore negative values Croll New Users to Excel 1 October 11th 05 05:55 PM
Formula to make Negative Values Positive & Positive Values Negative? mustard Excel Discussion (Misc queries) 4 September 26th 05 10:05 PM
... Count, <<< Positive Values minus Negative Values >>> ... Dr. Darrell Excel Worksheet Functions 4 September 8th 05 01:36 PM


All times are GMT +1. The time now is 06:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"