ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete same Rows/Columns from two worksheets at a time (https://www.excelbanter.com/excel-programming/329304-delete-same-rows-columns-two-worksheets-time.html)

Vinit[_2_]

Delete same Rows/Columns from two worksheets at a time
 
Hi friends,

How to Insert/delete same Rows/Columns from two worksheets at a time?
Is there a way to capture the Insert/delete Rows/Columns? so I can
insert/delete in both sheets on that event. One way is to group two
worksheets (But I want only Insert/Delete not other operations). The
solution for this is to group at the time of insert/delete and then
ungroup it. But I dont want to Group-Ungroup everytime.

Thanks & Regards,

Vinit


Duke Carey

Delete same Rows/Columns from two worksheets at a time
 
Vinit -

If you are talking about doing this in code, using an array of sheets is
fast and simple

Dim ws As Worksheet
For Each ws In Sheets(Array("Sheet1", "Sheet2"))
Rows("10:11").Delete Shift:=xlUp
Next

Doesn't group the sheets - just acts on all the sheets in your array

"Vinit" wrote:

Hi friends,

How to Insert/delete same Rows/Columns from two worksheets at a time?
Is there a way to capture the Insert/delete Rows/Columns? so I can
insert/delete in both sheets on that event. One way is to group two
worksheets (But I want only Insert/Delete not other operations). The
solution for this is to group at the time of insert/delete and then
ungroup it. But I dont want to Group-Ungroup everytime.

Thanks & Regards,

Vinit



Vinit[_2_]

Delete same Rows/Columns from two worksheets at a time
 
Duke,

I want it on Excels Row/Column delete event invoked by right click .



All times are GMT +1. The time now is 06:18 AM.

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