Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default Pasting Pivot data

Hi everyone,

I am pasting data from e.g sheet1 into sheet2 once I've used VBA to
add an autofilter and remove the blanks (thanks to Ron's site) and on
the sheet (and cell range) where I am pasting it, I use that range in
the Pivot Table Wizard as the array for the Pivot table.

I use sheet3 for the Pivot Table and in VBA select a cell within the
table and use a PivotTable.Refresh to update the table.

I wish to copy out the data from the updated Pivot Table in VBA (the
amount of rows in the tbale will vary as the pasting in of data
changes). However I am unsure how to declare the variables
I was thinking, something like r = 2, last row = range("b65536).xlUp

Coudl you help please?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Pasting Pivot data

Hey Simon!! Here are some examples:
Find Last Used Cell:
Sub FindLastCell1()
Cells(Rows.Count, "A").End(xlUp).Select
End Sub

Sub FindLastCell2()
Range("A:A").Find("*", Cells(1), _
xlValues, xlWhole, xlByRows, xlPrevious).Select
End Sub

Sub test()
With Sheets("Sheet1").Range("A1:A" & .Range( _
"A" & .Rows.Count).End(xlUp).Row).Copy Sheets("Sheet2").Range("A1")
End With
End Sub

Set StartRange and End Range:

Sub StartEnd()
Dim StartCell, EndCell As Range
Set StartCell = Range("A3")
Set EndCell = Cells(Rows.Count, "A").End(xlUp)
Range(StartCell, EndCell).Select
End Sub


Sub zeroo()
n = Cells(Rows.Count, "A").End(xlUp).Row
Range("A3:A" & n).Select
End Sub

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Simon" wrote:

Hi everyone,

I am pasting data from e.g sheet1 into sheet2 once I've used VBA to
add an autofilter and remove the blanks (thanks to Ron's site) and on
the sheet (and cell range) where I am pasting it, I use that range in
the Pivot Table Wizard as the array for the Pivot table.

I use sheet3 for the Pivot Table and in VBA select a cell within the
table and use a PivotTable.Refresh to update the table.

I wish to copy out the data from the updated Pivot Table in VBA (the
amount of rows in the tbale will vary as the pasting in of data
changes). However I am unsure how to declare the variables
I was thinking, something like r = 2, last row = range("b65536).xlUp

Coudl you help please?

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
pasting values from pivot table still linked ChrisC Excel Discussion (Misc queries) 0 March 24th 10 01:21 PM
pasting into pivot tables query paul perkins IOM Excel Discussion (Misc queries) 0 July 29th 09 11:23 AM
Why does data validation not work when pasting data into a cell. rjshelby Excel Discussion (Misc queries) 1 July 31st 06 09:08 PM
Pasting on Filtered Data Sheets without pasting onto hidden cells CCSMCA Excel Discussion (Misc queries) 1 August 28th 05 01:22 PM
Copying & Pasting from Pivot Table Connie Martin Excel Discussion (Misc queries) 3 March 22nd 05 04:01 PM


All times are GMT +1. The time now is 07:15 PM.

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"