PC Review


Reply
Thread Tools Rate Thread

Delete all Blank Rows from data table

 
 
Shazi
Guest
Posts: n/a
 
      25th Jun 2008
Hi,

I have Sheet1, where I put the filtered data from DailyPurchasing
sheet CategoryWise, it is variable data, every time the no. of rows
are different.
then I copy into Sheet1.

I made a macro to delete all the empty rows after the data is placed.
see my procedure.

Selection.End(xlDown).Select (after this line I need an other
line to delete variable data, because it is always changed. some time
15 rows and some time 50 rows are filtered.

the given below procedure deletes the data from A17. which is not
good.
I dont understand how to fix this problem.

pls help me out.


Sub DelRows()

Range("A4").Select
Selection.End(xlDown).Select
Range("A17").Select ' <== this should be some thing
else
Range(Selection, Selection.End(xlDown)).Select
Selection.EntireRow.Delete
Range("A4").Select

End Sub

Regards.

Shahzad
 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      25th Jun 2008
Sub DelRows()
With ActiveSheet
Set LastCell = .Range("A" & Rows.Count).End(xlUp)
.Range(.Range("A4"),
LastCell).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End With
End Sub

"Shazi" wrote:

> Hi,
>
> I have Sheet1, where I put the filtered data from DailyPurchasing
> sheet CategoryWise, it is variable data, every time the no. of rows
> are different.
> then I copy into Sheet1.
>
> I made a macro to delete all the empty rows after the data is placed.
> see my procedure.
>
> Selection.End(xlDown).Select (after this line I need an other
> line to delete variable data, because it is always changed. some time
> 15 rows and some time 50 rows are filtered.
>
> the given below procedure deletes the data from A17. which is not
> good.
> I dont understand how to fix this problem.
>
> pls help me out.
>
>
> Sub DelRows()
>
> Range("A4").Select
> Selection.End(xlDown).Select
> Range("A17").Select ' <== this should be some thing
> else
> Range(Selection, Selection.End(xlDown)).Select
> Selection.EntireRow.Delete
> Range("A4").Select
>
> End Sub
>
> Regards.
>
> Shahzad
>

 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      25th Jun 2008
Warning: See
http://www.rondebruin.nl/specialcells.htm

--

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


"Joel" <(E-Mail Removed)> wrote in message news:7EDA7A0F-B796-4FBB-ABC9-(E-Mail Removed)...
> Sub DelRows()
> With ActiveSheet
> Set LastCell = .Range("A" & Rows.Count).End(xlUp)
> .Range(.Range("A4"),
> LastCell).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
> End With
> End Sub
>
> "Shazi" wrote:
>
>> Hi,
>>
>> I have Sheet1, where I put the filtered data from DailyPurchasing
>> sheet CategoryWise, it is variable data, every time the no. of rows
>> are different.
>> then I copy into Sheet1.
>>
>> I made a macro to delete all the empty rows after the data is placed.
>> see my procedure.
>>
>> Selection.End(xlDown).Select (after this line I need an other
>> line to delete variable data, because it is always changed. some time
>> 15 rows and some time 50 rows are filtered.
>>
>> the given below procedure deletes the data from A17. which is not
>> good.
>> I dont understand how to fix this problem.
>>
>> pls help me out.
>>
>>
>> Sub DelRows()
>>
>> Range("A4").Select
>> Selection.End(xlDown).Select
>> Range("A17").Select ' <== this should be some thing
>> else
>> Range(Selection, Selection.End(xlDown)).Select
>> Selection.EntireRow.Delete
>> Range("A4").Select
>>
>> End Sub
>>
>> Regards.
>>
>> Shahzad
>>

 
Reply With Quote
 
Shazi
Guest
Posts: n/a
 
      25th Jun 2008
On 25 Jun, 22:12, "Ron de Bruin" <rondebr...@kabelfoon.nl> wrote:
> Warning: Seehttp://www.rondebruin.nl/specialcells.htm
>
> --
>
> Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm
>
>
>
> "Joel" <J...@discussions.microsoft.com> wrote in messagenews:7EDA7A0F-B796-4FBB-ABC9-(E-Mail Removed)...
> > Sub DelRows()
> > * With ActiveSheet
> > * *Set LastCell = .Range("A" & Rows.Count).End(xlUp)
> > * *.Range(.Range("A4"),
> > LastCell).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
> > * End With
> > End Sub

>
> > "Shazi" wrote:

>
> >> Hi,

>
> >> I have Sheet1, where I put the filtered data from DailyPurchasing
> >> sheet CategoryWise, it is variable data, every time the no. of rows
> >> are different.
> >> then I copy into Sheet1.

>
> >> I made a macro to delete all the empty rows *after the data is placed.
> >> see my procedure.

>
> >> * * Selection.End(xlDown).Select * (after this line I need an other
> >> line to delete variable data, because it is always changed. some time
> >> 15 rows and some time 50 rows are filtered.

>
> >> the given below procedure deletes the data from A17. which is not
> >> good.
> >> I dont understand how to fix this problem.

>
> >> pls help me out.

>
> >> Sub DelRows()

>
> >> * * Range("A4").Select
> >> * * Selection.End(xlDown).Select
> >> * * Range("A17").Select * * * * * * * ' <== thisshould be some thing
> >> else
> >> * * Range(Selection, Selection.End(xlDown)).Select
> >> * * Selection.EntireRow.Delete
> >> * * Range("A4").Select

>
> >> End Sub

>
> >> Regards.

>
> >> Shahzad- Hide quoted text -

>
> - Show quoted text -


Thank you Rone, you have given me good suggession. I like it.
I learn lot of things from your website, and I love you.

Regards.

Shahzad
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Blank Rows when Pivot Table included on sheet Joyce Microsoft Excel Programming 3 23rd Mar 2010 03:04 PM
Macro to delete blank rows in a data range Youlan Microsoft Excel Misc 5 17th Sep 2008 08:51 AM
delete all blank rows in a table marcia2026 Microsoft Excel Programming 2 12th Jul 2008 01:01 AM
How do I delete blank rows (rows alternate data, blank, data, etc =?Utf-8?B?bmNvY2hyYXg=?= Microsoft Excel Misc 2 27th Jun 2007 04:40 AM
How do I delete multiple BLANK rows within data? =?Utf-8?B?VGhlIE9sZCBCYWlsZXk=?= Microsoft Excel Misc 2 6th Sep 2004 12:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:52 PM.