Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Save HTML as simple text in Excel cell?

How can I save a string written as HTML format into Excel cell so that it
shows the content without these HTML tags?

Thanks for your help!

Weide
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default Save HTML as simple text in Excel cell?

If you are using code to save the string, you could insert the following
code after that line:

ActiveSheet.Hyperlinks.Delete

Or, use this code in the ThisWorkbook Module of the workbook:

Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
With Target.Hyperlinks
If .Count Then .Delete
End With
End Sub

Manually, right click the link, choose Remove Hyperlink. Only works on one
link at a time.

Or, to completely stop Excel from recognizing all links:
Tools, Options, Spelling Tab, Click on AutoCorrect Options button, remove
the checkmark from "Internet and network paths with hyperlinks".

Regards,

Alan



"Weide Zhang" wrote in message
...
How can I save a string written as HTML format into Excel cell so that it
shows the content without these HTML tags?

Thanks for your help!

Weide



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Save HTML as simple text in Excel cell?

Hi Alan,
Maybe my question is not clear enough. The string containing html tag is
like the following:

"<bJanuary</b 14, <b2000</b Rebuffed Internet extortionist posts stolen
<bcredit</b card data <br <b...</b Hacker targets <bCD Universe's
credit</b card data (Computerworld) <b...</b"

When I save the string, it just shows the whole content letter by letter.
But I am interested to know whether there is a way to let excel cell to
interpret the html string and displays it in a proper way.

Thanks a lot.

Weide

"Alan" wrote:

If you are using code to save the string, you could insert the following
code after that line:

ActiveSheet.Hyperlinks.Delete

Or, use this code in the ThisWorkbook Module of the workbook:

Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
With Target.Hyperlinks
If .Count Then .Delete
End With
End Sub

Manually, right click the link, choose Remove Hyperlink. Only works on one
link at a time.

Or, to completely stop Excel from recognizing all links:
Tools, Options, Spelling Tab, Click on AutoCorrect Options button, remove
the checkmark from "Internet and network paths with hyperlinks".

Regards,

Alan



"Weide Zhang" wrote in message
...
How can I save a string written as HTML format into Excel cell so that it
shows the content without these HTML tags?

Thanks for your help!

Weide




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Save HTML as simple text in Excel cell?

You could try this utility from Rob van Gelder. The code is visible
and so can be easily adapted.

http://vangelder.orcon.net.nz/excel/incellformat.zip

HTH

Peter

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Save HTML as simple text in Excel cell?

Hi, thanks a lot for providing this tool. But i need it to transform all the
selected cells not only the (1,1) cell. I dont know how to program in VBA,
could you help me on that?

Thanks a lot.

Weide

"Peter Grebenik" wrote:

You could try this utility from Rob van Gelder. The code is visible
and so can be easily adapted.

http://vangelder.orcon.net.nz/excel/incellformat.zip

HTH

Peter




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Save HTML as simple text in Excel cell?

Replace the code in module1 with the following code. Clicking the
button will process the cells that you have selected. Note that it
overwrites the original content of the cell.

Peter

Option Explicit

Sub test()
Dim strText As String
Dim rngCell As Range
Dim lCalcMode As Long

With Application
.ScreenUpdating = False
lCalcMode = .Calculation
.Calculation = xlCalculationManual
End With

For Each rngCell In Selection

With rngCell
strText = .Value
'only process a cell that contains ""
If InStr(strText, "") 0 Then
.ClearContents
WriteFormattedText rngCell, strText
.WrapText = True
End If
End With
Next

Application.Calculation = lCalcMode
End Sub

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Save HTML as simple text in Excel cell?

I took your string and pasted it into Notepad. I then added some data:

<html

<body

<bJanuary</b 14, <b2000</b Rebuffed Internet extortionist posts stolen
<bcredit</b card data <br
<b...</b Hacker targets <bCD Universe's credit</b card data
(Computerworld) <b...</b

</body

</html

I saved it to have a name with a .htm extension. I then opened that file in
excel in the normal way (file=Open) and all the tags were interpreted.

--
Regards,
Tom Ogilvy


"Weide Zhang" wrote in message
...
Hi, thanks a lot for providing this tool. But i need it to transform all
the
selected cells not only the (1,1) cell. I dont know how to program in VBA,
could you help me on that?

Thanks a lot.

Weide

"Peter Grebenik" wrote:

You could try this utility from Rob van Gelder. The code is visible
and so can be easily adapted.

http://vangelder.orcon.net.nz/excel/incellformat.zip

HTH

Peter




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
How do I save Excel to HTML without using frames? Midjack Excel Discussion (Misc queries) 0 August 20th 08 09:28 PM
Excel 2007 Save As HTML? leonbip Excel Discussion (Misc queries) 1 August 17th 07 02:22 AM
Can I Save an Excel spread sheet as html text Joe Miller Excel Discussion (Misc queries) 2 January 7th 06 04:57 PM
Can I Save an Excel spread sheet as html text? Joe Miller Excel Discussion (Misc queries) 5 January 2nd 06 10:47 PM
Can I Save an Excel spread sheet as html text? Joe Miller Excel Discussion (Misc queries) 0 December 31st 05 07:21 PM


All times are GMT +1. The time now is 02:34 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"