@googlegroups.com
Subject: Re: $$Excel-Macros$$ Re: delete blank columns
You can try this also
on error resume next
activesheet.specialcells(xlcelltypeblank).usedrange.entirecolumn.delete
on error goto 0: on error goto -1: err.clear
Regards,
Lalit Mohan
On Tue, Jun 26, 2012 at 7:09 PM
1 7838100659 [IM-Gtalk]
>
>
> -Original Message-
> From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
> On Behalf Of NOORAIN ANSARI
> Sent: 26 June 2012 12:23
> To: excel-macros@googlegroups.com
> Subject: Re: $$Excel-Macros$$ Re: delete
-Gtalk]
-Original Message-
From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
On Behalf Of NOORAIN ANSARI
Sent: 26 June 2012 12:23
To: excel-macros@googlegroups.com
Subject: Re: $$Excel-Macros$$ Re: delete blank columns
Please use it for blank column
Sub
Please use it for blank column
Sub delete_blankcolumn()
Dim i As Long
With ActiveSheet
For i = .Cells.SpecialCells(xlCellTypeLastCell).Row To 1 Step -1
If WorksheetFunction.CountA(.Columns(i)) = 0 Then
ActiveSheet.Columns(i).Delete
End
Hi Smitha,
you can also try it
Sub delete_blankcell()
Dim i As Long
With ActiveSheet
For i = .Cells.SpecialCells(xlCellTypeLastCell).Row To 1 Step -1
If WorksheetFunction.CountA(.Rows(i)) = 0 Then
ActiveSheet.Rows(i).Delete
End If
select the column & press Ctlr+g and go to blank and then press Alt+E D and
select row and delete .
Regards,
Gawli Anil
On Tue, Jun 26, 2012 at 11:34 AM, Prince Dubey wrote:
> Hi Smitha,
>
> Please use this Macro hope this help you.
>
> Public Sub DeleteBlankCols(strSheetName As String, strRange
Hi Smitha,
Please use this Macro hope this help you.
Public Sub DeleteBlankCols(strSheetName As String, strRange As String)
Dim intCountAs Integer
Dim rng As Range
With ThisWorkbook.Worksheets(strSheetName)
Set rng = .Range(strRange)
For intCoun