Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Simon Lloyd;636628 Wrote: Thats an imported carriage return, try the code below: Sub test() Dim r As Range On Error Resume Next With CreateObject("VBScript.RegExp") For Each r In ActiveSheet.UsedRange.SpecialCells(xlCellTypeConst ants, 2) .Pattern = "[\n\r]+" .Global = True r.Value = .Replace(r.Value, " ") .Pattern = "\s{2,}" .Global = True r.Value = .Replace(r.Value, " ") Next End With End Sub Thanks Simon, be mid afternoon before I get a chance to test it, but I'll let you know then how it goes, Neil -- StackemEvs ------------------------------------------------------------------------ StackemEvs's Profile: 1402 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=176694 Microsoft Office Help |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do you find and replace unwanted symbols in text cells? | Excel Discussion (Misc queries) | |||
Removing unwanted fonts | Excel Discussion (Misc queries) | |||
Removing unwanted digits | Excel Discussion (Misc queries) | |||
Removing unwanted characters | Excel Discussion (Misc queries) | |||
removing unwanted macros... | Excel Discussion (Misc queries) |