ParanoidAndroid
Board Regular
- Joined
- Jan 24, 2011
- Messages
- 50
Hi Guys
I would be very thankful if you could tell me what is wrong with the following mothod.
I simply want to delete a range in all worksheets except for the one titled Monkey.
The range will always start at A2 and i want it to delete until the last cell in column J.
It seems to be correct in deleting as far as the last row but not the last column
Dim ws As Worksheet<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Dim Last_cell_in_Range As Range<o></o>
For Each ws In ActiveWorkbook.Worksheets
If ws.name <> “Monkey” then
Range("J2", Range("A65536").End(xlUp)).Name = "Last_cell_in_Range"<o></o>
Range("A2:Last_cell_in_Range").Delete<o></o>
<o> </o>
Endif
next
I would be very thankful if you could tell me what is wrong with the following mothod.
I simply want to delete a range in all worksheets except for the one titled Monkey.
The range will always start at A2 and i want it to delete until the last cell in column J.
It seems to be correct in deleting as far as the last row but not the last column
Dim ws As Worksheet<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Dim Last_cell_in_Range As Range<o></o>
For Each ws In ActiveWorkbook.Worksheets
If ws.name <> “Monkey” then
Range("J2", Range("A65536").End(xlUp)).Name = "Last_cell_in_Range"<o></o>
Range("A2:Last_cell_in_Range").Delete<o></o>
<o> </o>
Endif
next