Thread
:
Q to Automate Removal of Characters from Cells
View Single Post
#
10
Posted to microsoft.public.excel.programming
Claus Busch
external usenet poster
Posts: 3,872
Q to Automate Removal of Characters from Cells
Hi,
Am Sat, 25 Jul 2015 04:01:53 -0700 (PDT) schrieb
:
One other twist, in Column E, I have similar format, except it doesn't have the - (minus sign) e.g " EURO 659.00
How could I also run the code over this column?
try:
Sub Replace()
Dim LRow As Long
Dim rngC As Range
LRow = Cells(Rows.Count, 4).End(xlUp).Row
For Each rngC In Range("D2:D" & LRow)
If InStr(rngC, "-") Then
rngC = Mid(rngC, InStr(rngC, "-"))
End If
Next
For Each rngC In Range("E2:E" & LRow)
If InStr(rngC, "EURO") Then
rngC = Mid(rngC, InStrRev(rngC, " "))
End If
Next
End Sub
Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
Reply With Quote
Claus Busch
View Public Profile
Find all posts by Claus Busch