Closed Thread
Results 1 to 3 of 3

Removing HTML tags (specifically <p> tags)

  1. #1
    Registered User
    Join Date
    07-02-2015
    Location
    San Gabriel, California
    MS-Off Ver
    2002
    Posts
    11

    Removing HTML tags (specifically <p> tags)

    Hi!

    I'm new here. This would be my first post. I am in dire need of some help with removing HTML tags from a CSV file. I have about 3600 entries to modify. I used:

    Sub RemoveTags()
    Dim r As Range
    Selection.NumberFormat = "@" 'set cells to text numberformat
    With CreateObject("vbscript.regexp")
    .Pattern = "\<.*?\>"
    .Global = True
    For Each r In Selection
    r.Value = .Replace(r.Value, "")
    Next r
    End With
    End Sub

    But that left me with about 880 entries with:

    <p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
    normal">

    I also tried find and replace using <*> for find and a empty replace field but I get the "Formula is too long" error message.

    I'm pretty new to VBA so any help is appreciated!

  2. #2
    Registered User
    Join Date
    07-02-2015
    Location
    San Gabriel, California
    MS-Off Ver
    2002
    Posts
    11

    Re: Removing HTML tags (specifically <p> tags)

    Sorry double post!! Delete!

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Removing HTML tags (specifically <p> tags)

    Yes, we have been having a few forum problems, I will close this for you, you can continue here...
    http://www.excelforum.com/excel-prog...ly-p-tags.html
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Removing HTML tags from a spreadsheet from data obtained through a database query
    By Excelfail in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-17-2014, 12:35 AM
  2. [SOLVED] Question about forum rules, code tags, formula tags
    By Jacc in forum The Water Cooler
    Replies: 2
    Last Post: 09-11-2012, 08:42 AM
  3. convert formated excel column to html source text with html tags
    By julia81 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-19-2011, 04:22 PM
  4. Removing HTML tags from cells
    By rochdalemark in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-22-2005, 06:09 AM

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