LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Loop Until Desired Columns left

Hello,

I'm using JLGWhiz's solution in posting "Deleting Column Based On Header"
to delete columns other than those correctly titled. - Below -

It works Fine but only when run several times or repeated.

Can someone help me enhance to automatically loop until either desired # of
columns with data or until Column Headers indicated below all that left ?

Dim C As Range
lc = Cells(1, Columns.Count).End(xlToLeft).Column
Set myRng = Range("A1", Cells(1, lc))
For Each C In myRng
If C < "Doc. Date" And C < "DocumentN" And C < "Type" And C <
"Reference" And C < "LC amnt" Then
C.EntireColumn.Delete
End If
Next

Many Thanks / Happy Holidays
Steven
all left
 
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
In Excel My Columns are going from right to left, how can I fix i. N 1000 Excel Discussion (Misc queries) 1 November 9th 07 12:34 AM
If < equal to named list require user to fill out desired columns? Matt Pierringer Excel Programming 2 March 7th 07 10:04 PM
Count number of times two columns have desired values Gavin Deveau Excel Discussion (Misc queries) 2 June 16th 06 06:29 PM
My columns run from right to left instead of left to right. Help? Marleneburton Setting up and Configuration of Excel 1 March 21st 06 08:31 AM
filtering columns-left nav agrillo Charts and Charting in Excel 0 December 1st 05 08:40 PM


All times are GMT +1. The time now is 09:47 PM.

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

About Us

"It's about Microsoft Excel"