I need a way to copy pivot table data down the column. Here is the scenario. Data is dumped into Excel from a larger source. I create a pivot table so the data detail is summarized. This data will be exported to Cognos. Before this step I need the data in column A to be copied down the section of the pivot table. Since this can not be done in a pivot table, I copied the table to another sheet. I think I need a macro that will first copy the pivot table (no matter what size) to another sheet and then copy the information in column A down into the blank cells. When the next data is found, the previous copy needs to stop and start a new copy/past proceedure. The distance between the sections will always vary depending on the amount of data from the pivot table. Can you help me? See Attachment.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
pivot data copy data (Excel 2000)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » pivot data copy data (Excel 2000)
- This topic has 4 replies, 2 voices, and was last updated 20 years, 1 month ago.
AuthorTopicWScindypositano
AskWoody LoungerMay 10, 2005 at 1:47 pm #419352Viewing 1 reply threadAuthorReplies-
WSHansV
AskWoody LoungerMay 10, 2005 at 2:20 pm #946652You can run this code from the worksheet containing the pivot table:
Sub CopyAndFill()
Dim lngRow As Long
ActiveSheet.PivotTables(1).TableRange2.Copy
Worksheets.Add
Selection.PasteSpecial Paste:=xlPasteValues
Selection.PasteSpecial Paste:=xlPasteFormats
For lngRow = 2 To Range(“A65536”).End(xlUp).Row
If Cells(lngRow, 1) = “” Then
Cells(lngRow, 1) = Cells(lngRow – 1, 1)
End If
Next lngRow
End Sub -
WScindypositano
AskWoody Lounger
-
-
WScindypositano
AskWoody Lounger -
WSHansV
AskWoody LoungerMay 10, 2005 at 8:11 pm #946719I have split the macro into two parts:
– Copying the pivot table to a new sheet.
– Filling the gaps in specified columns.Sub CopyPivot()
ActiveSheet.PivotTables(1).TableRange2.Copy
Worksheets.Add After:=Worksheets(Worksheets.Count)
Selection.PasteSpecial Paste:=xlPasteValues
Selection.PasteSpecial Paste:=xlPasteFormats
Application.CutCopyMode = False
End SubSub FillColumns(ParamArray varCols())
Dim lngRow As Long
Dim i As Long
Dim lngCol As Long
For i = LBound(varCols) To UBound(varCols)
lngCol = varCols(i)
For lngRow = 2 To Range(“A65536”).End(xlUp).Row
If Cells(lngRow, lngCol) = “” Then
Cells(lngRow, lngCol) = Cells(lngRow – 1, lngCol)
End If
Next lngRow
Next i
End SubSub CopyAndFill()
CopyPivot
‘ Modify as needed
FillColumns 1, 2, 4
End SubAs before, CopyAndFill is the macro to run. In this example, the gaps in columns 1, 2 and 4 (i.e. A, B and D) are filled. Adjust as needed.
-
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
End of support for Windows 10
by
Old enough to know better
20 minutes ago -
What goes on inside an LLM
by
Michael Covington
2 hours, 27 minutes ago -
The risk of remote access
by
Susan Bradley
3 hours, 59 minutes ago -
The cruelest month for many Office users
by
Peter Deegan
53 minutes ago -
Tracking protection and trade-offs in Edge
by
Mary Branscombe
4 hours, 1 minute ago -
Supreme Court grants DOGE access to confidential Social Security records
by
Alex5723
4 hours, 2 minutes ago -
EaseUS Partition Master free 19.6
by
Alex5723
5 hours, 1 minute ago -
Microsoft : Edge is better than Chrome
by
Alex5723
17 hours, 19 minutes ago -
The EU launched DNS4EU
by
Alex5723
1 day, 6 hours ago -
Cell Phone vs. Traditional Touchtone Phone over POTS
by
280park
20 hours, 22 minutes ago -
Lost access to all my networked drives (shares) listed in My Computer
by
lwerman
1 day, 11 hours ago -
Set default size for pasted photo to word
by
Cyn
1 day, 17 hours ago -
Dedoimedo tries 24H2…
by
Cybertooth
1 day, 5 hours ago -
Windows 11 Insider Preview build 27871 released to Canary
by
joep517
2 days, 16 hours ago -
Windows 11 ad from Campaign Manager in Windows 10
by
Jim McKenna
9 hours, 14 minutes ago -
Small desktops
by
Susan Bradley
8 hours, 20 minutes ago -
Totally disable Bitlocker
by
CWBillow
1 day, 10 hours ago -
Phishers extract Millions from HMRC accounts..
by
Microfix
2 days, 14 hours ago -
Windows 10 22H2 Update today (5 June) says up-to-date but last was 2025-04
by
Alan_uk
3 days, 20 hours ago -
Thoughts on Malwarebytes Scam Guard for Mobile?
by
opti1
1 day, 15 hours ago -
Mystical Desktop
by
CWBillow
3 days, 23 hours ago -
Meta and Yandex secretly tracked billions of Android users
by
Alex5723
3 days, 5 hours ago -
MS-DEFCON 2: Do you need that update?
by
Susan Bradley
16 hours, 18 minutes ago -
CD/DVD drive is no longer recognized
by
WSCape Sand
4 days, 14 hours ago -
Windows 11 24H2 Default Apps stuck on Edge and Adobe Photoshop
by
MikeBravo
4 days, 17 hours ago -
North Face and Cartier customer data stolen in cyber attacks
by
Alex5723
4 days, 15 hours ago -
What is wrong with simple approach?
by
WSSpoke36
2 days, 13 hours ago -
Microsoft-Backed Builder.ai Set for Bankruptcy After Cash Seized
by
Alex5723
5 days, 3 hours ago -
Location, location, location
by
Susan Bradley
3 days, 17 hours ago -
Cannot get a task to run a restore point
by
CWBillow
5 days, 4 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.