Results 1 to 1 of 1

Format Cell to display HTML code as formatted text

Threaded View

needhelp1 Format Cell to display HTML... 03-13-2013, 05:56 PM
  1. #1
    Registered User
    Join Date
    03-13-2013
    Location
    Florida, USA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Format Cell to display HTML code as formatted text

    Hi all, new to this forum and spend couple of hours digging for this but cant seem to find the right resolution.

    I am trying to convert the following HTML content that is displayed within a merged cell (A1-I1):

    "<OL> <LI>If i modify cheese.</LI> <LI>If i modify the filter.</LI> <LI>If i modify the filter to show.</LI> <LI>A "close" CTA is available.</LI></OL><BR>"

    So that it looks like this in the merged cell:

    1. If i modify cheese.
    2. If i modify the filter.
    3. If i modify the filter to show.
    4. A "close" CTA is available.

    This works if content is only in cell A1 but then copies to 4 rows.

    Sub Sample()
        Dim Ie As Object
    
        Set Ie = CreateObject("InternetExplorer.Application")
    
        With Ie
            .Visible = False
    
            .Navigate "about:blank"
    
            .document.body.InnerHTML = Sheets("Sheet1").Range("A1").Value
    
            .document.body.createtextrange.execCommand "Copy"
            ActiveSheet.Paste Destination:=Sheets("Sheet1").Range("A1")
    
            .Quit
        End With
    End Sub
    Last edited by needhelp1; 03-13-2013 at 09:00 PM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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