Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
My text has duplicate characters in the same cell, let's say the
character is "a". I want to find and replace all duplicates until there is never two a's in a row, so baaaat baaat baat bat becomes bat bat bat bat Should I use a Do While or Do Until loop for this? As in... Do Selection.Replace What:="aa", Replacement:="a", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False Loop Until [?????] Seems like using Excel's built-in Replace function would be the simplest and have the fastest execution. But what should be the condition which causes the loop to exit? What happens when a Replace call finds nothing? Thanks. (P.S. the duplicate characters are not letters, they're stuff like { and ^, so don't worry about messing up words like aardvark, as the above example would.) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming | |||
Find & Replace / Loop & Vlookup | Excel Programming | |||
Problem adding charts using Do-Loop Until loop | Excel Programming | |||
HELP!!!! Can't stop a loop (NOT an infinite loop) | Excel Programming | |||
Replace Loop | Excel Programming |