Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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

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
How to Delete entire rows by selecting different text in column A Doug[_5_] Excel Discussion (Misc queries) 2 November 20th 09 02:03 PM
CANNOT DELETE AN ENTIRE COLUMN ibeetb Excel Discussion (Misc queries) 4 June 23rd 06 02:55 AM
Easiest way to delete blank cells in column (not entire row) sramsey Excel Discussion (Misc queries) 4 February 16th 06 04:28 PM
Delete Entire Row If Column C is Blank John Excel Programming 5 July 19th 04 10:23 PM
How to detect an entire column/row delete event? MV[_2_] Excel Programming 1 September 10th 03 01:03 PM


All times are GMT +1. The time now is 03:29 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"