Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I have 25 columns. I need to write a macro which goes through each column, keeps: 1) Billing 2) GM 3) Total 4) Client 5) Project Name but deletes the rest I guess its something like this, many thks sub del() Dim i As Long Dim aryTest aryTest = Array("Billing ", "GM", "Total","Client","Project Name") For i = 25 To 1 Step -1 If Not IsError(Application.Match(Cells(1, i).Value, aryTest, 0)) Then 'Keep Else 'Delete End If Next i End Su -- T De Villier ----------------------------------------------------------------------- T De Villiers's Profile: http://www.excelforum.com/member.php...fo&userid=2647 View this thread: http://www.excelforum.com/showthread.php?threadid=56779 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro deletes wrong columns | Excel Discussion (Misc queries) | |||
Macro that deletes every third row....+ | Excel Discussion (Misc queries) | |||
Macro That Deletes Columns | Excel Programming | |||
Name x as y Deletes file | Excel Programming | |||
Repetative Row Deletes | Excel Discussion (Misc queries) |