ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete selected range (https://www.excelbanter.com/excel-programming/347859-delete-selected-range.html)

RW

Delete selected range
 
Here's the code

Set WshD = ThisWorkBook.WorkSheets("index")
Set RngD = WshD.Range("M65536".End(xlUP)
RngD = RngD.Offset(0,-12).Resize(11,12).Delete

I've also used Select in place of Delete above and then added
Selection.Delete on the next line.
I used the Offset before resize since I read in this forum that Resize
doesn't like negative values.

How do I delete the newly selected range?

Tom Ogilvy

Delete selected range
 
Set WshD = ThisWorkBook.WorkSheets("index")
Set RngD = WshD.Range("M65536".End(xlUP)
RngD.Offset(0,-12).Resize(11,12).Delete Shift:=xlShiftUp

--
Regards,
Tom Ogilvy


"RW" wrote in message
...
Here's the code

Set WshD = ThisWorkBook.WorkSheets("index")
Set RngD = WshD.Range("M65536".End(xlUP)
RngD = RngD.Offset(0,-12).Resize(11,12).Delete

I've also used Select in place of Delete above and then added
Selection.Delete on the next line.
I used the Offset before resize since I read in this forum that Resize
doesn't like negative values.

How do I delete the newly selected range?




RW

Delete selected range
 
Thanks!

"Tom Ogilvy" wrote:

Set WshD = ThisWorkBook.WorkSheets("index")
Set RngD = WshD.Range("M65536".End(xlUP)
RngD.Offset(0,-12).Resize(11,12).Delete Shift:=xlShiftUp

--
Regards,
Tom Ogilvy


"RW" wrote in message
...
Here's the code

Set WshD = ThisWorkBook.WorkSheets("index")
Set RngD = WshD.Range("M65536".End(xlUP)
RngD = RngD.Offset(0,-12).Resize(11,12).Delete

I've also used Select in place of Delete above and then added
Selection.Delete on the next line.
I used the Offset before resize since I read in this forum that Resize
doesn't like negative values.

How do I delete the newly selected range?






All times are GMT +1. The time now is 03:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com