Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default macro for parsing text

hello, I am trying to modify a recorded macro that replaces an HTML tag
with "". The macro I recorded is below. I want to replace the 7 in the
Rows parameter with a counter, i, and use a For ..Next statement to
loop through each row in the worksheet. However, this is giving me an
app error. Does anyone know how I can do this? Thanks.


------ Original Macro -------
Sub CleanHTML()

' CleanHTML Macro
' Macro recorded 4/17/2006 by Mark Oium

Rows("7:7").Select
Selection.Replace What:="<*", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub

------ Modified Macro ------
Sub CleanHTML()

Dim i as Integer

'CleanHTML Macro
'Macro recorded 4/17/2006 by Mark Oium

For i = 1 To 1396
Rows("i:i").Select
Selection.Replace What:="<*", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Next i
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default macro for parsing text

Remove select statement


Rows(i).Replace What:=".........

" wrote:

hello, I am trying to modify a recorded macro that replaces an HTML tag
with "". The macro I recorded is below. I want to replace the 7 in the
Rows parameter with a counter, i, and use a For ..Next statement to
loop through each row in the worksheet. However, this is giving me an
app error. Does anyone know how I can do this? Thanks.


------ Original Macro -------
Sub CleanHTML()

' CleanHTML Macro
' Macro recorded 4/17/2006 by Mark Oium

Rows("7:7").Select
Selection.Replace What:="<*", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub

------ Modified Macro ------
Sub CleanHTML()

Dim i as Integer

'CleanHTML Macro
'Macro recorded 4/17/2006 by Mark Oium

For i = 1 To 1396
Rows("i:i").Select
Selection.Replace What:="<*", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Next i
End Sub


Reply
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
macro for parsing text [email protected] Excel Programming 4 April 14th 06 04:56 PM
Pause Macro For Start Row While Parsing a Text File Bill Foster[_2_] Excel Programming 2 November 9th 05 08:47 PM
Parsing imported text file with macro... help! scrupul0us[_2_] Excel Programming 0 September 7th 04 10:13 PM
NEED EXCEL MACRO TEXT-PARSING GURU! amywolfie Excel Programming 2 May 18th 04 04:27 PM
NEED EXCEL MACRO TEXT-PARSING GURU! amywolfie Excel Programming 1 May 17th 04 06:14 PM


All times are GMT +1. The time now is 05:41 AM.

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

About Us

"It's about Microsoft Excel"