Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
can someone explain why this code works with or without the for and next
lines? if i take out the for and next lines, it still apears to do the search and replace on all lines in the worksheet thanks ------------------------------------------------- Application.ScreenUpdating = False For x = LastRow To 1 Step -1 Cells.Replace What:=""" """, Replacement:=",", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Cells.Replace What:="""", Replacement:="", LookAt:=xlPart, SearchOrder _ :=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False Next x Columns("A:A").Select Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _ TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _ Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _ :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1)), _ TrailingMinusNumbers:=True Range("A1").Select Columns("A:E").EntireColumn.AutoFit Application.ScreenUpdating = True -- Gary |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Search and Replace | New Users to Excel | |||
Search and Replace Question | New Users to Excel | |||
Simple Search and Replace Question | Excel Discussion (Misc queries) | |||
Search and Replace... | Excel Programming | |||
Macro search replace question | Excel Programming |