Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default How to find errors in documents

when you have a series of data and you have a space or error in your numbers
when you are using functions and formulas. how do you find where there error
is in the data if you cant see the space or cant see where the error might be
that is causing the formula answer to be wrong.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 293
Default How to find errors in documents

Hi Pnoahjones,

Numbers with spaces are treated by Excel as text. Provided you're using the default cell format, rather than left-aligned, the text
strings will be right-aligned.

You can clean up a selected range, or a whole worksheet using the macro below:
Sub TrimRange()
Dim SBar As Boolean, Cell As Range, CellCount As Long, I As Long
SBar = Application.DisplayStatusBar
Application.DisplayStatusBar = True
Application.ScreenUpdating = False
Application.Calculation = xlManual
On Error Resume Next
I = 0
If Selection.Rows.Count * Selection.Columns.Count 1 Then
CellCount = Selection.Rows.Count * Selection.Columns.Count
Else
CellCount = ActiveSheet.UsedRange.Rows.Count * ActiveSheet.UsedRange.Columns.Count
End If
For Each Cell In Selection.SpecialCells(xlConstants)
Cell.Value = Application.Trim(Replace(Cell.Value, Chr(160), " "))
I = I + 1
Application.StatusBar = Int(I / CellCount * 100 + 0.5) & "% Trimmed"
Next Cell
Application.Calculation = xlAutomatic
Application.StatusBar = False
Application.DisplayStatusBar = SBar
Application.ScreenUpdating = True
MsgBox "Finished trimming " & CellCount & " cells.", 64
End Sub

The macro gives a progress report on the Excel status bar and a message box when it's finished.

--
Cheers
macropod
[Microsoft MVP - Word]


"Pnoahjones" wrote in message ...
when you have a series of data and you have a space or error in your numbers
when you are using functions and formulas. how do you find where there error
is in the data if you cant see the space or cant see where the error might be
that is causing the formula answer to be wrong.


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
Documents move is generating link errors in Excel rtlemurs Excel Discussion (Misc queries) 0 June 25th 08 08:36 PM
Find and Replace Lookup errors Julie Excel Discussion (Misc queries) 7 July 13th 07 09:36 PM
cannot find c:\documents and settings Old Bob Excel Discussion (Misc queries) 6 October 31st 05 06:45 PM
To find errors Kalevi New Users to Excel 1 October 14th 05 03:43 PM
Print errors with Word documents in Excel spreadsheets mike-ss Excel Discussion (Misc queries) 0 August 10th 05 05:11 PM


All times are GMT +1. The time now is 01:28 AM.

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

About Us

"It's about Microsoft Excel"