Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Deleting selective columns


Hi, I have 25 columns.
I need to write a macro which goes through each column and
keeps:
1) Billing
2) GM
3) Total
4) Client
5) Project Name

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 Sub


--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479
View this thread: http://www.excelforum.com/showthread...hreadid=567538

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
filters for selective columns? evilchrissy Excel Discussion (Misc queries) 2 July 21st 09 02:07 PM
Copying Selective columns Oldjay[_2_] Excel Programming 1 October 18th 05 11:05 PM
Selective Deleting Hesham Excel Programming 3 September 27th 05 09:43 PM
Selective stacking of columns in a chart Excel_lence Excel Discussion (Misc queries) 2 July 8th 05 06:35 PM
Conditional/selective deleting Tom Ogilvy Excel Programming 0 September 17th 03 02:13 PM


All times are GMT +1. The time now is 04:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"