p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   BOOK: Excel 2003 VBA Programmer's Reference (http://p2p.wrox.com/book-excel-2003-vba-programmers-reference-142/)
-   -   EntireRow.Delete (http://p2p.wrox.com/book-excel-2003-vba-programmers-reference/93740-entirerow-delete.html)

Wenggo October 26th, 2014 07:50 AM

EntireRow.Delete
 
[:confused:]

Evening all,

When compiled range below are not executed. Can somebody help..

Set a1range = Sheets("Sheets01").Range("A3:AD" & Lastrow)

but Ok for :-

Set bRange = Sheets("Sheets02").Range("A2:AD" & Lastrow)


Below was my full coding, try it you will see what I mean..

Sub DeleteR(0

Dim Lastrow As Integer
Dim aRange, bRange As Range


Lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row


set aRange = Sheets("Sheets01").Range("A2:AD" & Lastrow)
Set bRange = Sheets("Sheets02").Range("A2:AD" & Lastrow)

Set a1range = Sheets("Sheets01").Range("A3:AD" & Lastrow)
Set b1range = Sheets("Sheets02").Range("A3:AD" & Lastrow)

aRange.ClearContents
bRange.ClearContents

a1Range.EntireRow.Delete
b1Range.EntireRow.Delete

End Sub


All times are GMT -4. The time now is 11:01 PM.

Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.