Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Append column for pasting

I want to paste the results from a pivot table into a column. I want t
do this each time the pivot table refreshes so that it is pasting int
the first empy row of the column range (i.e. its appending to th
previous results.

I can think of two ways to do this but don't really know how to do it'

1) name first cell in paste column and

Range("A").Select
Range(Selection, Selection.End(xlDown)).Select
And paste destination = 1 extra row to this

2) Use dynamic past range and paste to it plus 1 extra row.

Any thoughts on how to code this?

Thank

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Append column for pasting

One way. This will need to be adapted as required :-

'----------------------------------
Sub test()
Dim FromSheet As Worksheet
Dim ToSheet As Worksheet
Dim C1 As String ' top of copy range
Dim C2 As String ' bottom of copy range
Dim LastRow As Long
'- from
Set FromSheet = ActiveSheet
C1 = "B3" ' top of pt column
C2 = "B" & FromSheet.Range(C1).End(xlDown).Row
'-to
FromSheet.Range(C1 & ":" & C2).Copy
Set ToSheet = ThisWorkbook.Worksheets("Sheet1")
LastRow = ToSheet.Range("A6536").End(xlUp).Row + 1
ToSheet.Paste Destination:=ToSheet.Range("A" & LastRow)
End Sub
'--------------------------------


---
Message posted from http://www.ExcelForum.com/

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
how to select and append a column in VB and excel tia sal2 sal2 Excel Discussion (Misc queries) 2 January 27th 09 06:29 PM
how to select and append a column in VB and excel tia sal2 sal2 Excel Worksheet Functions 2 January 27th 09 06:29 PM
append column data ACarella Excel Worksheet Functions 3 July 22nd 08 06:13 PM
How do I append same text to all the cells in a column at once? Abhijit Bamishte Excel Worksheet Functions 4 December 15th 06 07:26 PM
How do I append data in several cells in one column Tim Excel Discussion (Misc queries) 4 November 16th 05 10:04 PM


All times are GMT +1. The time now is 08:54 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"