Below is a macro that stores the search items in an array and replaces with nothing. I couldn't include <P style*> in this array because it is replaced with a value.
Unfortunately this bumps the completion time back up to how long it takes with a manually recorded macro. It was suggested to me to put the column in an array and 'work on that' I do not know how to do that; any help is appreciated. I'm unsure why my tagged code is previewing weirdly sorry.
Unfortunately this bumps the completion time back up to how long it takes with a manually recorded macro. It was suggested to me to put the column in an array and 'work on that' I do not know how to do that; any help is appreciated. I'm unsure why my tagged code is previewing weirdly sorry.
Code:
Sub recreate()
Dim StartTime As Double
Dim SecondsElapsed As Double
'Remember time when macro starts
StartTime = Timer
Sheets("Columns").Range("F2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Replace What:="<p style*>", Replacement:="<p>", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Dim Ar(1 To 17) As String '~~> 4 to number of items
Dim i As Long
Dim Ar2(1) As String '~~> 1 to number of items
Dim a As Long
Ar(1) = "<span style*>"
Ar(2) = "<div>"
Ar(3) = "<div style=*>"
Ar(4) = "<tbody>"
Ar(5) = "</div>"
Ar(6) = "<ul style=*>"
Ar(7) = "<li style=*>"
Ar(8) = "<table style*>"
Ar(9) = "<col style*>"
Ar(10) = "<tr style=*>"
Ar(11) = "<td class=*>"
Ar(12) = "<colgroup>"
Ar(13) = "</colgroup>"
Ar(14) = "</tbody>"
Ar(15) = "</td>"
Ar(16) = "</tr>"
Ar(17) = "</table>"
For i = 1 To UBound(Ar)
Sheets("Columns").Columns(6).Replace What:=Ar(i), _
Replacement:="", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False, _
SearchFormat:=False, _
ReplaceFormat:=False
Next i
'Determine how many seconds code took to run
SecondsElapsed = Round(Timer - StartTime, 2)
'Notify user in seconds
MsgBox "This code ran successfully in " & SecondsElapsed & " seconds", vbInformation
End Sub