How to delete undesired rows

I have reports in which no. of rows has been changed. I have create a macro to sorting the report. Its work fine with 144 rows. But whenever there are more rows in report macro still shows first 144 rows. How can I program my macro to work accurately?

How to delete undesired rows

Dear raj007avi,

Implement below code syntax in your Macro.

Go to first cell of your data in upper-left corner and use:

Selection.Sort _
Key1:=Range("B1"), Order1:=xlAscending, _
Header:=xlYes, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom

Here B1 should be replaced with the first cell of the column of your data that is to be sorted.

Do let me know if you need any help further.

you can find sample file with code on below link:

https://drive.google.com/file/d/0B0cMzwsd-SDeZzFTZ0hFR0FCSmc/edit?usp=sh...

Regards,
Nitesh Mhatre.