• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

deleting last row in range

ysherriff

Member
I have the following vba code that searches for the last row with data and then deletes up. But i want to modify it where it only selects the range with the last data instead dand then select the range and move up. The range for the selection from column b to column i.

Range("start_revach_view").Select
Selection.End(xlDown).Select
rownum = Selection.Row
Range("b" & rownum + 1).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.EntireRow.Delete

I tried to modify it to below but it selects everything and deletes.

Range("start_revach_view").Select
Selection.End(xlDown).Select
rownum = Selection.Row
Range("b5:i5" & rownum + 1).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.EntireRow.Delete

Can someone help please?

Thank you.
 
I have uploaded the file with the ranges need to be modified in yellow.

Thanks
 

Attachments

  • PSR Monthly Incentive Calculator Template v.02.xls
    62.5 KB · Views: 4
Back
Top