'Hi Shakeel

'Try the following code:-

Sub shakeel()
Application.ScreenUpdating = False
Application.DisplayAlerts = False

Dim i, k As Integer
Cells(1, 1).Select
For k = 1 To 256
ActiveCell.EntireColumn.Select
i = Application.WorksheetFunction.CountA(Selection)
If i = 0 Then
ActiveCell.EntireColumn.Delete
Else
ActiveCell.Offset(0, 1).EntireColumn.Select
End If
Next
MsgBox ("All emply columns have been deleted - Dilipandey")
End Sub
'note: = File containing macro is also attached.

'Thanks & Regards,
'Dilipandey
'--
'DILIP KUMAR PANDEY
  'MBA-HR,B COM(Hons.),BCA
'Mobile: +91 9810929744
'dilipan...@gmail.com
'dilipan...@yahoo.com
'New Delhi - 110062
On Fri, May 29, 2009 at 10:31 PM, Abdul Shakeel <shakeel....@gmail.com>wrote:

>  Hi All,
>
>
>
> I am searching for macro that hide or delete column(s) if they haven’t any
> values, & if any cell in that particular column(s) have any value then we
> couldn’t delete or hide the column.
>
>
>
> Regards,
>
>
>
> Shakeel
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
-------------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
-------------------------------------------------------------------------------------
-~----------~----~----~----~------~----~------~--~---

Attachment: Delete Blank Columns.xls
Description: MS-Excel spreadsheet

Reply via email to