Paste to next available row - not working.

cccbzg

Board Regular
Joined
Oct 5, 2014
Messages
68
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm trying to copy selected rows from one worksheet to the next available row on another - something I've done before! BUT IT DOESN'T WORK! I've tried all kinds of variations, but all I get is the last of the copied rows, which makes me think it is overlaying the previous rows. I would be eternally grateful if someone could see what I'm missing.

Many thanks,
Bonnie


If COPYLINE <> "YES" Then GoTo SKIPCOPY
'**
MsgBox "output Stuff"


Dim copySheet As Worksheet
Dim pasteSheet As Worksheet
Set copySheet = Worksheets("Summary Sheet")
Set pasteSheet = Worksheets("Your Dates")
Application.ScreenUpdating = False
copySheet.Range("A" & i & ":M" & i).Copy
pasteSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1).PasteSpecial xlPasteValues
Application.CutCopyMode = False
Application.ScreenUpdating = True

SKIPCOPY:
'

Next

ENDitall:
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Your code is missing the values you want i to assume. Something like:

For i = startValue to endValue
.......
Next i
 
Upvote 0
Hi JoeMo,

The code I sent is in a big For Next, which I'm sure it goes through since the message "Output Stuff" comes up at the appropriate times.


My output to "Your Dates" is only the last of the rows that should be copied, so I'm assuming the others are being overwritten.

Thanks for taking the time to look at my code.

Thanks,
Bonnie
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top