LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default How do you insert rows in a sheet that has a PivotTable

I am trying to programatically add rows to a worksheet that has a PivotTable,
but I always get an error.

Here is the code:

Dim sheet As Excel.Worksheet
Dim cell, newCell As Excel.Range

Set sheet = Application.ActiveSheet
Set cell = sheet.Cells(1, 1)
cell.Select
cell.Insert (Excel.XlInsertShiftDirection.xlShiftDown)

This code works if the worksheet does not contain a PivotTable. The
PivotTable is located at cell A3 so it shouldn't be in the way of the
inserted row.

Thanks in advance for any insight on how to make this work.
 
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
2007 excel work sheet will not allow to insert rows or columns David Excel Discussion (Misc queries) 1 January 24th 09 07:30 PM
copy rows based on conditions and insert them into another sheet... [email protected] Excel Programming 3 November 25th 07 10:22 PM
copy cells in two columns if in bold to another sheet and insert rows [email protected][_2_] Excel Programming 4 June 12th 07 06:01 PM
Insert Rows in Balance Sheet Template Teacher_Becky New Users to Excel 2 November 21st 05 02:15 AM
In Excell sheet i want to insert more than 65,536 rows how i can . Girish.G Excel Worksheet Functions 3 April 6th 05 12:51 PM


All times are GMT +1. The time now is 04:22 AM.

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

About Us

"It's about Microsoft Excel"