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: 24
Default Copy & Paste to Last Empty Row

I am trying to copy data from DestSheet to the last empty row in
PivotTableData worksheet. I have the following code which does everything
correctly until the last line. The "LastRowTemp" variable has the correct
value, however, the copy never happens. I get an error that says.... "Run
time error 424: Object Required".

I've checked & my variables are all named correctly. Any ideas?

Thanks!

Dim DestSheet As Worksheet
Dim PivotTableData As Worksheet
Dim LastRowTemp As Long

Set DestSheet = Sheets("Sheet3")
Set PivotTableData = Worksheets("Sheet4")

PivotTableData.Activate
LastRowTemp = Cells(Rows.Count, 1).End(xlUp)(2).Row !Get last empty row
'Copy columns User Name from Sheet 1 to Sheet 2
With DestSheet
.Range(.Range("A2"), .Range("F2").End(xlDown)).Copy
End With
PivotTableData.["A" & LastRowTemp].End(xlUp)(1).PasteSpecial Paste:=xlValues
 
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
Find first empty cell in column J. Copy, paste special, value from zzxxcc Excel Programming 12 September 12th 07 10:34 PM
Clipboard empty but get cannot empty CB when trying to copy Peter @ ServiceMaster Excel Worksheet Functions 0 February 22nd 07 03:58 PM
Copy and Paste in the first empty available line. Etienne Excel Programming 5 August 3rd 06 03:49 PM
cannot cut & paste because clipboard is empty Duce New Users to Excel 0 June 21st 06 10:58 PM
macro to copy paste non empty data paritoshmehta[_22_] Excel Programming 0 July 1st 04 09:17 PM


All times are GMT +1. The time now is 08:34 AM.

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

About Us

"It's about Microsoft Excel"