View Single Post
  #1 (permalink)  
Old October 26th, 2014, 07:50 AM
Wenggo Wenggo is offline
Authorized User
Points: 287, Level: 5
Points: 287, Level: 5 Points: 287, Level: 5 Points: 287, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2006
Location: Stone, California, Malaysia.
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default EntireRow.Delete



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
Reply With Quote