Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following code is an example that will work for you, may need
modifying if you have a large spreadsheet as my example only deletes one column at a time. Dave, Kendal Sub test() Cells.Select Selection.Sort Key1:=Range("A3"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight Application.Goto Reference:="R3C1" While IsEmpty(ActiveCell) = False If ActiveCell = 0 Then ActiveCell.EntireColumn.Delete ElseIf ActiveCell 0 Then ActiveCell.Offset(0, 1).Range("A1").Select End If Wend End Sub "jacqui" wrote in message ... Rob, Thanks for your suggestion. Unfortunately the i counter doesn't work when the code finds a column to delete 'cause what should be the next column to test becomes the current column in the loop and then the counter increments again so it's effectively skipping a column each time. That's why I was going to work the loop from right to left rather than left to right. Can you help I'm still stuck with the syntax Jacqui |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to delete a 'Select Box' | Excel Discussion (Misc queries) | |||
Search & delete ANY text in select columns | Excel Discussion (Misc queries) | |||
Delete Select Targets | Excel Discussion (Misc queries) | |||
How to select a row to delete | Excel Programming | |||
Conditional Row Select and Delete | Excel Programming |