Copy and Paste without deleting existing data

Niinja

New Member
Joined
Jun 2, 2021
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Hello All,

I'm looking to copy the data cells A28:N46 through to the range of A58:N106 with a button click macro without deleting any data that had previously been put into the range of A58:N106.

+ I would also love to be able to then clear contents on the data that was copied if possible.

So Far I have this:

"Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Dim xSheet As Worksheet
Set xSheet = ActiveSheet
If xSheet.Name <> "Definitions" And xSheet.Name <> "fx" And xSheet.Name <> "Needs" Then
xSheet.Range("A28:N46 ").Copy
xSheet.Range("A58:106").PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End If

Application.ScreenUpdating = True
End Sub"
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Your requirements are not very clear, your "paste" range is not the same size as the copy range. you haven't specified how to deal with this , also you have specified how to deal with cells in the paste range that do have data in them . So just as an example to try and help here is some code that picks up the data in A28:N46 and pastes it into the range A58:A76 by concatenating it with any data that already exists in that range.
VBA Code:
Sub test()
copar = Range("A28:N46")
pasar = Range("A58:N76")
For i = 1 To UBound(copar, 1)
 For j = 1 To UBound(copar, 2)
  pasar(i, j) = pasar(i, j) & copar(i, j)
 Next j
Next i
Range("A58:N76") = pasar


End Sub
 
Upvote 0
I'm trying to do the following. The last right-hand row is Column 'N'.

Copy data without deleting data validation etc, and paste into the A64 and below rows.
 

Attachments

  • Issue.PNG
    Issue.PNG
    50.7 KB · Views: 19
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,212
Members
452,618
Latest member
Tam84

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