Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Insert rows in grouped sheets

I'm trying insert rows in grouped sheets. I am using the following
code:

Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Rows(9).Resize(3, 1).EntireRow.Insert Shift:=xlDown

The sheets are grouped, however the additional rows are only inserted
in sheet1. How do I get the additional rows inserted in the all the
sheets in the array?


Thanks

Paul
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Insert rows in grouped sheets

The grouped sheet behavior you're trying to use only works from the
keyboard. You can try to simulate that with SendKeys:

Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Rows(9).Resize(3, 1).EntireRow.Select
SendKeys "^{+}"


"halibut" wrote in message
...
I'm trying insert rows in grouped sheets. I am using the following
code:

Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Rows(9).Resize(3, 1).EntireRow.Insert Shift:=xlDown

The sheets are grouped, however the additional rows are only inserted
in sheet1. How do I get the additional rows inserted in the all the
sheets in the array?


Thanks

Paul


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default Insert rows in grouped sheets

On Oct 13, 1:30*am, halibut wrote:
I'm trying insert rows in grouped sheets. I am using the following
code:

Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Rows(9).Resize(3, 1).EntireRow.Insert Shift:=xlDown

The sheets are grouped, however the additional rows are only inserted
in sheet1. How do I get the additional rows inserted in the all the
sheets in the array?

Thanks

Paul


Sub insertrows()
For Each ws In Array("Sheet1", "Sheet2", "Sheet3")
Sheets(ws).Rows(9).Resize(3).Insert
Next ws
End Sub
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert rows in many sheets Arne Hegefors Excel Programming 2 December 20th 07 11:58 AM
"Add/Remove Rows Code" adds rows on grouped sheets, but won't remove rows. Conan Kelly Excel Programming 1 November 16th 07 10:41 PM
insert rows in multi sheets Charlie Brown Excel Programming 0 August 20th 06 11:04 PM
Links between sheets in error due to insert rows Sarah Excel Discussion (Misc queries) 5 March 3rd 06 06:31 PM
Insert rows on multiple sheets Tom Ogilvy Excel Programming 0 November 7th 03 02:57 PM


All times are GMT +1. The time now is 03:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"