LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default search and replace question

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search and Replace Rebecca New Users to Excel 2 June 5th 06 06:42 AM
Search and Replace Question Rebecca New Users to Excel 1 April 11th 05 04:49 AM
Simple Search and Replace Question Rebecca Excel Discussion (Misc queries) 2 April 3rd 05 03:33 PM
Search and Replace... Paul B[_7_] Excel Programming 0 October 1st 03 06:12 PM
Macro search replace question WDP[_2_] Excel Programming 1 August 28th 03 06:18 AM


All times are GMT +1. The time now is 01:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"