Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Deleting all HTML coding while keeping text

Is there a way to delete all HTML commands in a cell (ex.
BR, TABLE, FONT) while keeping the text that it affects? I
have 3000 rows with product descriptions, most of which
include HTML, that I must convert into a text only
description.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Deleting all HTML coding while keeping text

If you have a list of them, you can do it with Edit=Replace

You will need to do each distinct command individually or write a macro that
loops throught the list of HTML commands and issues the replace command.

--
Regards,
Tom Ogilvy

"Helen" wrote in message
...
Is there a way to delete all HTML commands in a cell (ex.
BR, TABLE, FONT) while keeping the text that it affects? I
have 3000 rows with product descriptions, most of which
include HTML, that I must convert into a text only
description.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Deleting all HTML coding while keeping text

Unfortunately, I do not know how to write macros.

When I use the Replace command, I get a message that 'The
formula is too long'.

Any suggestions?

Thanks!
-----Original Message-----
If you have a list of them, you can do it with

Edit=Replace

You will need to do each distinct command individually

or write a macro that
loops throught the list of HTML commands and issues the

replace command.

--
Regards,
Tom Ogilvy

"Helen" wrote in

message
...
Is there a way to delete all HTML commands in a cell

(ex.
BR, TABLE, FONT) while keeping the text that it

affects? I
have 3000 rows with product descriptions, most of which
include HTML, that I must convert into a text only
description.



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Deleting all HTML coding while keeping text

You do

Edit=Replace

What: TABLE
With: Leave blank

and it says formula too long?

--
Regards,
Tom Ogilvy

"Helen" wrote in message
...
Unfortunately, I do not know how to write macros.

When I use the Replace command, I get a message that 'The
formula is too long'.

Any suggestions?

Thanks!
-----Original Message-----
If you have a list of them, you can do it with

Edit=Replace

You will need to do each distinct command individually

or write a macro that
loops throught the list of HTML commands and issues the

replace command.

--
Regards,
Tom Ogilvy

"Helen" wrote in

message
...
Is there a way to delete all HTML commands in a cell

(ex.
BR, TABLE, FONT) while keeping the text that it

affects? I
have 3000 rows with product descriptions, most of which
include HTML, that I must convert into a text only
description.



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Deleting all HTML coding while keeping text

Hi Helen,
Is everything in one column, and if so does it belong in
one column. What version of Excel, and how did you
you create this in the first place.

If you copied and pasted from HTML into Excel with
Excel 2000 and above, and possibly Excel 97, you
wouldn't see HTML code in your cells.

Try this on a copy of your spreadsheet.

Sub Remove_HTML()
'David McRitchie, programming, 2004-04-13
'--http://google.com/groups?threadm=1ae2d01c41f37%2443ffb3b0%24a401280a @phx.gbl

Dim cell As Range, cellx As String, Rng As Range
Dim i As Long, j As Long
Set Rng = Intersect(Selection, _
Selection.SpecialCells(xlConstants, xlTextValues))
If Rng Is Nothing Then Exit Sub
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
For Each cell In Rng
cellx = cell.Value
redo:
For i = 1 To Len(cellx)
If Mid(cellx, i, 1) = "<" Then
For j = i + 1 To Len(cellx)
If Mid(cellx, j, 1) = "" Then
cellx = Left(cellx, i - 1) & Mid(cellx, j + 1)
GoTo redo
End If
Next j
End If
Next i
cell.Value = Replace(cellx, "&nbsp;", " ")
Next cell
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub

To install and use a macro see Getting Started with macros
http://www.mvps.org/dmcritchie/excel/getstarted.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Helen" wrote in message ...
Is there a way to delete all HTML commands in a cell (ex.
BR, TABLE, FONT) while keeping the text that it affects? I
have 3000 rows with product descriptions, most of which
include HTML, that I must convert into a text only
description.



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
Deleting HTML form objects? GeorgeM Excel Discussion (Misc queries) 3 December 29th 06 11:24 PM
how do i convert spreadsheets to html keeping the comments paula Excel Discussion (Misc queries) 0 June 17th 06 01:20 PM
HTML coding in Excel VBA Sheela Excel Programming 3 September 8th 03 04:57 PM


All times are GMT +1. The time now is 02:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"