Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Macro for Deleting rows with balnk cell

Hi,

i have several data in a sheet with data in 10 columns...

in column A there are cells where it is blank and i want to delete the rows
where there is blank cell in column A..
I need the vba macro for this

regards,
radha
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Macro for Deleting rows with balnk cell

Try

Sub DeleteBlankRows_2()
'This macro delete all rows with a blank cell in column A
'If there are no blanks or there are too many areas you see a MsgBox
Dim CCount As Long
On Error Resume Next

With Columns("A") ' You can also use a range like this Range("A1:A8000")
CCount = .SpecialCells(xlCellTypeBlanks).Areas(1).Cells.Cou nt
If CCount = 0 Then
MsgBox "There are no blank cells"
ElseIf CCount = .Cells.Count Then
MsgBox "There are more then 8192 areas"
Else
.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End If
End With

On Error GoTo 0
End Sub

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Macro for Deleting rows with balnk cell

Turn on macro recorder.

Select column A and F5SpecialBlanksOK

EditDelteEntire row.

The recorder gives you this.

Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete


Gord Dibben MS Excel MVP

On Wed, 2 Jun 2010 08:00:01 -0700, Radhakant Panigrahi
wrote:

Hi,

i have several data in a sheet with data in 10 columns...

in column A there are cells where it is blank and i want to delete the rows
where there is blank cell in column A..
I need the vba macro for this

regards,
radha


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Macro for Deleting rows with balnk cell

For the OP

I suggest to use more code then the macro recorder create
See my reply

And see why here
http://www.rondebruin.nl/specialcells.htm



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


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
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Excel Programming 2 November 13th 08 01:32 PM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Setting up and Configuration of Excel 1 November 12th 08 06:05 PM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Excel Worksheet Functions 1 November 12th 08 01:39 PM
Macro Help Needed: Comparing cell values and deleting rows [email protected] Excel Discussion (Misc queries) 1 September 19th 06 02:39 AM
Macro Help for Deleting Blank Rows & Clearing Cell Contents ksp Excel Programming 2 January 13th 06 05:25 AM


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