Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Formula Is Too Long
I have an external database that allows me to export to Excel.
When I do so, it also export these html tags into Excel (and there are many). Some Example Tags: <p; <br / I highlight the column where these tags are at - I do an Edit Find In the Find Field I type in the tag: <p And I Replace with: (this is left blank) A popup tells me "Formula Is Too Long" Sometimes it would eliminate the tags from the first few rows, but never the entire column. How can I eliminate these multiple tags from the cells? |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Formula Is Too Long
Saved from a previous post:
You can use a macro to do the change: Option Explicit Sub testme01() Dim FoundCell As Range Dim ConstCells As Range Dim BeforeStr As String Dim AfterStr As String BeforeStr = "$$$$$" AfterStr = " " 'or chr(10) 'for alt-enter With ActiveSheet Set ConstCells = Nothing On Error Resume Next Set ConstCells = .Cells.SpecialCells(xlCellTypeConstants, _ xlTextValues) On Error GoTo 0 If ConstCells Is Nothing Then MsgBox "Select some cells in the used range" Exit Sub End If With ConstCells 'get as many as we can in one step .Replace what:=BeforeStr, Replacement:=AfterStr, _ lookat:=xlPart, SearchOrder:=xlByRows Do Set FoundCell = .Cells.Find(what:=BeforeStr, _ after:=.Cells(1), _ LookIn:=xlValues, _ lookat:=xlPart, _ SearchOrder:=xlByRows, _ searchdirection:=xlNext, _ MatchCase:=False) If FoundCell Is Nothing Then 'done, get out! Exit Do End If FoundCell.Value _ = Replace(FoundCell.Value, BeforeStr, AfterStr) Loop End With End With End Sub If you're using xl97, change that Replace() to application.substitute() If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm Ps. Try it against a copy of your data--just in case! NeedHelp! wrote: I have an external database that allows me to export to Excel. When I do so, it also export these html tags into Excel (and there are many). Some Example Tags: <p; <br / I highlight the column where these tags are at - I do an Edit Find In the Find Field I type in the tag: <p And I Replace with: (this is left blank) A popup tells me "Formula Is Too Long" Sometimes it would eliminate the tags from the first few rows, but never the entire column. How can I eliminate these multiple tags from the cells? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
formula too long | Excel Worksheet Functions | |||
Clearing cells takes long, long time | Excel Discussion (Misc queries) | |||
Formula too long using IF OR | Excel Worksheet Functions | |||
formula too long! | Excel Discussion (Misc queries) | |||
Formula too long | Excel Worksheet Functions |