I need to do more than one cell at a time.
I need to do more than one cell at a time.
lee type your question the body of the text please.
sub removecarret()
dim cel as range
for each cel in activesheet.usedrange
cel = replace(cel,chr(13),"")
next
end sub
UNTESTED but it should work
--
When you lose your mind, you free your life.
"Lee" wrote:
> I need to do more than one cell at a time.
Saved from a previous post to a more generic question:
You can use Chip Pearson's Cell View addin to find out the character it is:
http://www.cpearson.com/excel/CellView.htm
If those box characters are char(10)'s (alt-enters), you can use
edit|Replace
what: ctrl-j
with: (spacebar??)
replace all
If that box character is something else, you may need a macro:
Option Explicit
Sub cleanEmUp()
Dim myBadChars As Variant
Dim myGoodChars As Variant
Dim iCtr As Long
myBadChars = Array(Chr(13)) '<--What showed up in CellView?
myGoodChars = Array(" ")
If UBound(myGoodChars) <> UBound(myBadChars) Then
MsgBox "Design error!"
Exit Sub
End If
For iCtr = LBound(myBadChars) To UBound(myBadChars)
ActiveSheet.Cells.Replace What:=myBadChars(iCtr), _
Replacement:=myGoodChars(iCtr), _
LookAt:=xlPart, SearchOrder:=xlByRows, _
MatchCase:=False
Next iCtr
End Sub
If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
Lee wrote:
>
> I need to do more than one cell at a time.
--
Dave Peterson
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks