Entire Column Delete

E

ermeko

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top