Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel workbook; how do I insert row in all worksheets?
|
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub AABB()
Worksheets.Select Range("B7").EntireRow.Select Selection.Insert ActiveSheet.Select End Sub -- Regards, Tom Ogilvy "Diana" wrote in message ... Excel workbook; how do I insert row in all worksheets? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Diana,
You can shelect multiple sheets by pressing the shift or ctrl key while selecting them , then all actions done to the active sheet is automatically done to other selected sheets. Click a non-selected sheet or the active sheet tab to ungroup them. Programmatically: the bellow example selects/groups sheets sheet1 and sheet2, and insert arow at 16. Sheets(Array("Sheet1", "Sheet2")).Select Rows("16:16").Insert Shift:=xlDown Regards, Sebastien "Diana" wrote: Excel workbook; how do I insert row in all worksheets? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What version of Excel? That doesn't work in Excel 97 or Excel 2000 (as
expected). VBA doesn't provide much support for grouped sheets. If you use the selection object, you can get some of that functionality. -- Regards, Tom Ogilvy "sebastienm" wrote in message ... Hi Diana, You can shelect multiple sheets by pressing the shift or ctrl key while selecting them , then all actions done to the active sheet is automatically done to other selected sheets. Click a non-selected sheet or the active sheet tab to ungroup them. Programmatically: the bellow example selects/groups sheets sheet1 and sheet2, and insert arow at 16. Sheets(Array("Sheet1", "Sheet2")).Select Rows("16:16").Insert Shift:=xlDown Regards, Sebastien "Diana" wrote: Excel workbook; how do I insert row in all worksheets? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I only have xl2000 and the code works perfectly fine on my machine.
Regards, Sébastien "Tom Ogilvy" wrote: What version of Excel? That doesn't work in Excel 97 or Excel 2000 (as expected). VBA doesn't provide much support for grouped sheets. If you use the selection object, you can get some of that functionality. -- Regards, Tom Ogilvy "sebastienm" wrote in message ... Hi Diana, You can shelect multiple sheets by pressing the shift or ctrl key while selecting them , then all actions done to the active sheet is automatically done to other selected sheets. Click a non-selected sheet or the active sheet tab to ungroup them. Programmatically: the bellow example selects/groups sheets sheet1 and sheet2, and insert arow at 16. Sheets(Array("Sheet1", "Sheet2")).Select Rows("16:16").Insert Shift:=xlDown Regards, Sebastien "Diana" wrote: Excel workbook; how do I insert row in all worksheets? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
think you need to look closer at the non active sheet. Sure you aren't
assuming the row was added there? -- Regards, Tom Ogilvy "sebastienm" wrote in message ... I only have xl2000 and the code works perfectly fine on my machine. Regards, Sébastien "Tom Ogilvy" wrote: What version of Excel? That doesn't work in Excel 97 or Excel 2000 (as expected). VBA doesn't provide much support for grouped sheets. If you use the selection object, you can get some of that functionality. -- Regards, Tom Ogilvy "sebastienm" wrote in message ... Hi Diana, You can shelect multiple sheets by pressing the shift or ctrl key while selecting them , then all actions done to the active sheet is automatically done to other selected sheets. Click a non-selected sheet or the active sheet tab to ungroup them. Programmatically: the bellow example selects/groups sheets sheet1 and sheet2, and insert arow at 16. Sheets(Array("Sheet1", "Sheet2")).Select Rows("16:16").Insert Shift:=xlDown Regards, Sebastien "Diana" wrote: Excel workbook; how do I insert row in all worksheets? |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
To confirm what Tom said, Sébastien's code does not work for me on
non-active albeit selected/grouped sheet(s) in my xl97 and xl2k. However this from the macro recorder does: Sheets(Array("Sheet1", "Sheet2")).Select 'Sheets("Sheet1").Activate 'recorded but not necessary Rows("16:16").Select Selection.Insert Shift:=xlDown But Sébastien's "manual" tip works fine. Regards, Sandy Tom Ogilvy wrote: think you need to look closer at the non active sheet. Sure you aren't assuming the row was added there? "sebastienm" wrote in message I only have xl2000 and the code works perfectly fine on my machine. Regards, Sébastien "Tom Ogilvy" wrote: What version of Excel? That doesn't work in Excel 97 or Excel 2000 (as expected). VBA doesn't provide much support for grouped sheets. If you use the selection object, you can get some of that functionality. -- Regards, Tom Ogilvy "sebastienm" wrote in message ... Hi Diana, You can shelect multiple sheets by pressing the shift or ctrl key while selecting them , then all actions done to the active sheet is automatically done to other selected sheets. Click a non-selected sheet or the active sheet tab to ungroup them. Programmatically: the bellow example selects/groups sheets sheet1 and sheet2, and insert arow at 16. Sheets(Array("Sheet1", "Sheet2")).Select Rows("16:16").Insert Shift:=xlDown Regards, Sebastien "Diana" wrote: Excel workbook; how do I insert row in all worksheets? |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Diana
Right-click on any sheet tab and "select all sheets". Insert your row on active sheet and will be done to all sheets. DO NOT FORGET to ungroup the sheets when task completed. What you do to one sheet in a group is done to all. Gord Dibben Excel MVP On Sun, 5 Sep 2004 10:59:06 -0700, "Diana" wrote: Excel workbook; how do I insert row in all worksheets? |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Diana,
- - - - - - - - - - - - - - - - - - - - - - - - - - Option Explicit Sub Test() Dim SHT As Worksheet For Each SHT In Worksheets SHT.Rows(1).Insert Next End Sub - - - - - - - - - - - - - - - - - - - - - - - - - - -- Regards, Soo Cheon Jheong _ _ ^¢¯^ -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel-how to link source workbook to copy of destination workbook | Excel Worksheet Functions | |||
when opening an Excel Workbook, another blank workbook also opens | Excel Discussion (Misc queries) | |||
Excel workbook is corrupted, workbook automatically saves on start | Excel Discussion (Misc queries) | |||
Open a password protected excel workbook from second workbook to fetch data using dynamic connection | Excel Programming | |||
Excel Gurus = want a macro in 1 workbook to get info from another workbook = Read please | Excel Programming |