Save HTML as simple text in Excel cell?
Thanks, Peter, it really helps.
Weide
"Peter Grebenik" wrote:
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
|