Rem Versuch macht klu.....
Sub
TestThis()
Dim
strLookAt
As
String
Dim
rngUsed
As
Range, c
As
Range
Dim
lngx
As
Long
Sheets.Add
Range(
"A1"
).
Select
Range(
"A2"
).Value =
"a a"
Range(
"B3"
).Value =
"b b"
Range(
"C400"
).Value = Chr(32)
Range(
"DD500"
).Value =
" "
MsgBox
"UsedRange "
& ActiveSheet.UsedRange.Address
strLookAt =
" "
MsgBox
"found at "
& Cells.Find(What:=strLookAt, LookAt:=xlWhole).Address
MsgBox
"found next "
& Cells.FindPrevious.Address
Set
rngUsed = ActiveSheet.UsedRange
Application.Calculation = xlCalculationManual
Application.ScreenUpdating =
False
Set
rngUsed = ActiveSheet.UsedRange.SpecialCells(xlCellTypeConstants, 23)
For
Each
c
In
rngUsed
c.Value = WorksheetFunction.Clean(c.Value)
c.Value = Trim(c.Value)
Next
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating =
True
MsgBox
"UsedRange "
& ActiveSheet.UsedRange.Address
If
Not
Cells.Find(What:=strLookAt, LookAt:=xlWhole)
Is
Nothing
Then
_
MsgBox
"found !"
If
Not
Cells.FindPrevious
Is
Nothing
Then
_
MsgBox
"found next !"
End
Sub