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



I need help in deleting rows. I have sheets with 10 columns with rows
ranging from 800-2400. I need to delete the rows which has empty data on
column 1. I would really appreciate your prompt help. Thanks in advance.
--
bpz
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Macro for deleting rows

Public Sub DeleteEmptyRows()
Dim lRow As Long

For lRow = 2400 To 800 Step -1
If Cells(lRow, 1).Value = "" Then
Cells(lRow, 1).EntireRow.Delete
Exit For
End If
Next lRow
End Sub

Cheers,
Flemming


"benxprezoise" wrote in message
...


I need help in deleting rows. I have sheets with 10 columns with rows
ranging from 800-2400. I need to delete the rows which has empty data on
column 1. I would really appreciate your prompt help. Thanks in advance.
--
bpz



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Macro for deleting rows

Range("A800:A2400").SpecialCells(xlCellTypeBlanks) .EntireRow.Delete


--

HTH

RP
(remove nothere from the email address if mailing direct)


"benxprezoise" wrote in message
...


I need help in deleting rows. I have sheets with 10 columns with rows
ranging from 800-2400. I need to delete the rows which has empty data on
column 1. I would really appreciate your prompt help. Thanks in advance.
--
bpz



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro for deleting rows

I can't make the formula work.

This is how my worksheet looks like and lets say I name the range as SAMPLE.

A B C D
1 J 01/20/05 123
2 J 01/20/05 123
3 01/20/05 123
.. J 0122 1223
..
..
500 J


I want to delete the rows without J's in column A. Also I need the formula
to start looking in Row 1.

Thanks for your help.



--
bpz


"Flemming Dahl" wrote:

Public Sub DeleteEmptyRows()
Dim lRow As Long

For lRow = 2400 To 800 Step -1
If Cells(lRow, 1).Value = "" Then
Cells(lRow, 1).EntireRow.Delete
Exit For
End If
Next lRow
End Sub

Cheers,
Flemming


"benxprezoise" wrote in message
...


I need help in deleting rows. I have sheets with 10 columns with rows
ranging from 800-2400. I need to delete the rows which has empty data on
column 1. I would really appreciate your prompt help. Thanks in advance.
--
bpz




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Macro for deleting rows


"benxprezoise" wrote in message
...
I can't make the formula work.

This is how my worksheet looks like and lets say I name the range as

SAMPLE.

A B C D
1 J 01/20/05 123
2 J 01/20/05 123
3 01/20/05 123
. J 0122 1223
.
.
500 J


I want to delete the rows without J's in column A. Also I need the formula
to start looking in Row 1.


You originally said for rows 800 to 2400, now you are saying starting at 1.

Try this

iLastRow = Cells(Rows.Count,"B").End(xlUp).Row
Range("A1:A" & iLastRow).SpecialCells(xlCellTypeBlanks).EntireRow .Delete


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 Links and Linking in Excel 1 November 13th 08 08:44 AM
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 deleting specified rows Snoopy Charts and Charting in Excel 0 February 15th 06 12:56 PM
deleting rows macro fullymooned[_5_] Excel Programming 2 June 16th 04 10:27 PM


All times are GMT +1. The time now is 03:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"