700C TestOk
what is the name of you sheet
Hi,Try to insert the line
VBA Code:a = Array("Date", "Time", "Sr No", "Associate") Sheets("700C Test").Select For i = 1 To [/QUOTE]
Selection.Find(What:="JobOrderNo", After:=ActiveCell, LookAt:=xlWhole).Activate
On Error GoTo 1
ActiveCell.EntireColumn.Delete
1 Selection.Find(What:="ModelDesc", After:=ActiveCell, LookAt:=xlWhole).Activate
On Error GoTo 2
ActiveCell.EntireColumn.Delete
2 Selection.Find(What:="xxxxx", After:=ActiveCell, LookAt:=xlWhole).Activate
ActiveCell.EntireColumn.Delete
On Error GoTo 3
3 ....
a = Array("Date", "Time", "Sr No", "Associate", "JobOrderNo", "ModelDesc")
Sub testr()
Dim rg As Range
Dim a As Variant
Dim i, ii
a = Array("Date", "Time", "Sr No", "Associate", "JobOrderNo", "ModelDesc")
For i = 1 To 100
For ii = 0 To UBound(a)
If Cells(1, i) = a(ii) Then
If rg Is Nothing Then
Set rg = Cells(1, i)
Else
Set rg = Union(rg, Cells(1, i))
End If: End If
Next: Next
rg.EntireColumn.Delete
End Sub
Hi,Still this working
Told you to edit the line
VBA Code:a = Array("Date", "Time", "Sr No", "Associate", "JobOrderNo", "ModelDesc")
VBA Code:Sub testr() Dim rg As Range Dim a As Variant Dim i, ii a = Array("Date", "Time", "Sr No", "Associate", "JobOrderNo", "ModelDesc") For i = 1 To 100 For ii = 0 To UBound(a) If Cells(1, i) = a(ii) Then If rg Is Nothing Then Set rg = Cells(1, i) Else Set rg = Union(rg, Cells(1, i)) End If: End If Next: Next rg.EntireColumn.Delete End Sub