Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Delete all Blank Rows from data table

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Delete all Blank Rows from data table

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Delete all Blank Rows from data table

Warning: See
http://www.rondebruin.nl/specialcells.htm

--

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


"Joel" wrote in message ...
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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Delete all Blank Rows from data table

On 25 Jun, 22:12, "Ron de Bruin" wrote:
Warning: Seehttp://www.rondebruin.nl/specialcells.htm

--

Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm



"Joel" wrote in ...
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- 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
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 to delete blank rows and move data/info samoan Excel Discussion (Misc queries) 3 September 19th 08 04:50 PM
Macro to delete blank rows in a data range Youlan Excel Discussion (Misc queries) 5 September 17th 08 08:51 AM
reformating data- how to delete alternate blank rows quickly datamanipulator Excel Discussion (Misc queries) 4 November 27th 07 04:41 PM
How do I delete blank rows (rows alternate data, blank, data, etc ncochrax Excel Discussion (Misc queries) 2 June 27th 07 04:40 AM
Delete rows ere first cell is blank but ohters celld have data? Mascot Excel Programming 1 July 26th 06 03:44 AM


All times are GMT +1. The time now is 01:31 AM.

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"