Sub Remove_CR_LF()
With Selection
..Replace What:=Chr(39), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
..Replace What:=Chr(146) & Chr(10), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
..Replace What:=Chr(180), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
End With
End Sub
Sub Remove_CR_LF()
With Selection
..Replace What:=Chr(160), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
..Replace What:=Chr(13) & Chr(10), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
..Replace What:=Chr(10), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
End With
End Sub
You have lots of response now. One of these must work...
HTH,
Ryan---
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.
"Dave Peterson" wrote:
> Saved from a previous post:
>
> If you want to see what's left in that cell after you convert ="" to values,
> try:
> Tools|Options|Transition Tab|Toggle Transition Navigation keys on.
>
> Then select one of those cells and look at the formula bar. You'll see an
> apostrophe. (Don't forget to toggle the setting to off.)
>
> When I want to clean up this detritus, I do this:
>
> Select the range (ctrl-a a few times to select all the cells)
> Edit|Replace
> what: (leave blank)
> with: $$$$$
> replace all
>
> Immediately followed by:
> Edit|Replace
> what: $$$$$
> with: (leave blank)
> replace all
>
> In code you could do something like:
>
> Option Explicit
> Sub testme()
> With ActiveSheet
> With .cells 'or a specific range: With .Range("D
")
> .Replace what:="", replacement:="$$$$$", LookAt:=xlWhole, _
> SearchOrder:=xlByRows, MatchCase:=False
> .Replace what:="$$$$$", replacement:="", LookAt:=xlWhole, _
> SearchOrder:=xlByRows, MatchCase:=False
> End With
> End With
> End Sub
>
> Steven B wrote:
> >
> > Hello all,
> >
> > I have found, in a number of my workbooks, ranges that contain cells
> > that appear to be blank, but excel treats them as though they have
> > data. When I sort a column ascending, these cells end up at the top of
> > my list. Selecting and clearing them removes whatever value is hidden
> > there and they no longer sort to the top of my lists.
> >
> > I'd like to be able to find them and clear all of them in my workbook
> > but I can't figure out how to "find" them.
> >
> > Thoughts?
> >
> > Steven
>
> --
>
> Dave Peterson
>