Option Explicit
'A - "FullName" bleibt
'B - "BookingReference" bleibt
'C - "EntryDate" bleibt
'D - "ExitDate" bleibt
'E - "BookingItemID" wird gelöscht
'F - "BookingItemFromDate" wird gelöscht
'G - "BookingItemToDate" wird gelöscht
'I - "ConsolidatorId" wird gelöscht
'J - "CarParkName" wird gelöscht
'K - "BookingStatus" wird gelöscht
'L - "TypeOfItem" wird gelöscht
'M - "VRNumber" wird gelöscht
'N - "BookingItemTotalCost" wird gelöscht
'O - "BookingItemTotalPaid" bleibt
'P - "SupplierReference" wird gelöscht
'Q - "ItemName" bleibt
'R - "RenewalStatus" wird gelöscht
Sub Test()
'alles in aktivem Arbeitsblatt
'
Dim arr(), v, c
arr = Array("BookingItemID", "BookingItemFromDate", "BookingItemToDate", _
"ConsolidatorId", "CarParkName", "BookingStatus", "TypeOfItem", _
"VRNumber", "BookingItemTotalCost", "SupplierReference", "RenewalStatus")
With Range("S1")
If .Value <> vbNullString Then .EntireColumn.Delete
End With
For Each v In arr
Set c = Cells.Find(What:=v, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then c.EntireColumn.Delete
Next v
End Sub
|