+ Reply to Thread
Results 1 to 2 of 2

macro for parsing text

Hybrid View

  1. #1

    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. #2
    Toppers
    Guest

    RE: macro for parsing text

    Remove select statement


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

    "[email protected]" 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1