Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try this...
PivotTableData.Cells(LastRowTemp, "A").PasteSpecial Paste:=xlValues -- HTH... Jim Thomlinson "ALATL" wrote: 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this:
PivotTableData.Range("A" & LastRowTemp).End(xlUp)(1).PasteSpecial Paste:=xlValues -- If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "ALATL" wrote: 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this:
Set DestSheet = Sheets("Sheet3") Set PivotTableData = Worksheets("Sheet4") LastRowDest = Range("F65536").End(xlUp).Row PivotTableData.Activate LastRowTemp = Cells(Rows.Count, 1).End(xlUp).Row 'Copy columns User Name from Sheet 1 to Sheet 2 With DestSheet .Range(.Range("A2"), .Range("F2:F" & LastRowDest)).Copy Destination:=PivotTableData.Range("A" & LastRowTemp) End With -- If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "ALATL" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find first empty cell in column J. Copy, paste special, value from | Excel Programming | |||
Clipboard empty but get cannot empty CB when trying to copy | Excel Worksheet Functions | |||
Copy and Paste in the first empty available line. | Excel Programming | |||
cannot cut & paste because clipboard is empty | New Users to Excel | |||
macro to copy paste non empty data | Excel Programming |