Dan
Hopefully you closed the workbook without saving<g>
I will go over the first macro to see what's changing the $10.00 to
1000.00 and
make changes. Glad you pointed that out.
Try this macro on a copy of the worksheet. You will have to run it twice.
Once
for " and once for ^
Public Sub Strip_Pick()
''strips out whichever character you input
Dim myRange As Range
Dim cell As Range
Dim myStr As String
Dim i As Integer
With Application
.ScreenUpdating = False
.Calculation = xlManual
End With
On Error Resume Next
Set myRange = Range(ActiveCell.Address & _
"," & Selection.Address) _
.SpecialCells(xlCellTypeConstants)
If myRange Is Nothing Then Exit Sub
If Not myRange Is Nothing Then
pick = InputBox("Enter the character to strip out")
gett = Asc(UCase(pick))
For Each cell In myRange
myStr = cell.text
For i = 1 To Len(myStr)
If (Asc(UCase(Mid(myStr, i, 1))) = gett) Then
myStr = Left(myStr, i - 1) & " " & Mid(myStr, i + 1)
End If
Next i
cell.Value = Application.Trim(myStr)
Next cell
End If
Selection.Replace What:=" ", _
Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
With Application
.Calculation = xlAutomatic
.ScreenUpdating = True
End With
End Sub
Gord
The symbols are visible in the cells. I tried the macro and it stripped
out
too much. For example, some of the cells have strings of text and it took
out all the spaces between the words. Also, it did something to all the
numbers....where there was $10.00, it changed it to 1000.00
"Gord Dibben" <gorddibbATshawDOTca> wrote in message
First question...............
Do these marks show in the cell or just in the Formula Bar?
If the latter, they are Lotus formatting marks.
Tools>Options>Transition, Uncheck all the Transition settings.
Then use the TRIM function to remove extra spaces.
If marks are actually visible in the cells, run this macro.
Public Sub StripAll_But_NumText()
Dim rConsts As Range
Dim rCell As Range
Dim i As Long
Dim sChar As String
Dim sTemp As String
On Error Resume Next
Set rConsts = Selection.SpecialCells(xlCellTypeConstants)
On Error GoTo 0
If Not rConsts Is Nothing Then
For Each rCell In rConsts
With rCell
For i = 1 To Len(.text)
sChar = Mid(.text, i, 1)
If sChar Like "[0-9a-zA-Z]" Then _
sTemp = sTemp & sChar
Next i
.Value = sTemp
End With
sTemp = ""
Next rCell
End If
End Sub
Gord Dibben MS Excel MVP
I copied some data from a report on a web page into excel.
The numbers have a " and a space in front of them, the dates have a ^ in
front. I tried find and replace and it didn't find these symbols. How
can
I remove these? They are making my formulas not work because excel
doesn't
recognize the numbers.
Thanks.