Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Entire Column Delete
Hi,
I have 100 columns. Some of then have value some don't. The task is to delete the columns that don't have any value. But when I delete the N th column the "N+1" th column becomes N th column and even it has no value I can not delete it. Below is the code. Can anybody help me? For M = 1 To 100 If objWrk.ActiveSheet.Cells(1, M).Value = "" Then objWrk.ActiveSheet.Cells(1, M).EntireColumn.Delete End If Next M |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Entire Column Delete
try doing it backwards
for 100 to 2 step -1 -- Don Guillett SalesAid Software "ermeko" wrote in message ... Hi, I have 100 columns. Some of then have value some don't. The task is to delete the columns that don't have any value. But when I delete the N th column the "N+1" th column becomes N th column and even it has no value I can not delete it. Below is the code. Can anybody help me? For M = 1 To 100 If objWrk.ActiveSheet.Cells(1, M).Value = "" Then objWrk.ActiveSheet.Cells(1, M).EntireColumn.Delete End If Next M |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Entire Column Delete
THANK YOU VERY MUCH
"ermeko" wrote: Hi, I have 100 columns. Some of then have value some don't. The task is to delete the columns that don't have any value. But when I delete the N th column the "N+1" th column becomes N th column and even it has no value I can not delete it. Below is the code. Can anybody help me? For M = 1 To 100 If objWrk.ActiveSheet.Cells(1, M).Value = "" Then objWrk.ActiveSheet.Cells(1, M).EntireColumn.Delete End If Next M |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Entire Column Delete
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to Delete entire rows by selecting different text in column A | Excel Discussion (Misc queries) | |||
CANNOT DELETE AN ENTIRE COLUMN | Excel Discussion (Misc queries) | |||
Easiest way to delete blank cells in column (not entire row) | Excel Discussion (Misc queries) | |||
Delete Entire Row If Column C is Blank | Excel Programming | |||
How to detect an entire column/row delete event? | Excel Programming |