Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Range of Columns
Try something like the following:
Dim R As Excel.Range Set R = Range("F1") Do Until Application.CountA(R.EntireColumn) = 0 Set R = R(1, 2) Loop ' the empty column will be delete with the other cols. ' to leave the blank column in place, uncomment the ' next line: 'Set R = R(1, 0) Range(Range("F1"), R).EntireColumn.Delete This will delete columns from F to the next empty column. That empty column will be delete with the others. To leave the empty column intact, uncomment the Set R = R(1,0) line of code. Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2009 Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Mon, 21 Sep 2009 08:13:01 -0700, James wrote: can you please show me how to delete the entire column starting in column f until an empty column is encountered. thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Delete Range of Columns | Excel Programming | |||
Delete & Merge Columns,Delete Rows with filter, etc | Excel Programming | |||
create a macro to delete columns and then border remaining columns | Excel Programming | |||
Delete columns of a cell range | Excel Discussion (Misc queries) | |||
Delete Columns For A Range | Excel Programming |