VBA for multiple paste

Slicemahn

Board Regular
Joined
Jun 10, 2004
Messages
120
Hello Everyone,

Is there a way to advance your cursor to the end of pasted data? And if there are multiple ranges to be pasted could there be code written?

Let me know your thoughts everyone.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Hello Slicemahn

You don't need to move the cursor or select or anything like that to copy and paste data. And, yes - you can copy and paste to multiple ranges.

So, what do you want to do?
 
Upvote 0
Thanks for your reply. You know how you may have text with data within Outlook and you want to copy and paste them into a spreadsheet. As soon as one block of data is pasted, you have to go back to the source and then back to the spreadsheet find the end of the data previously pasted and then paste in the new block of data. I was thinking that if there a worksheet event that would advance the MS Excel to end of the previously pasted range to facilitate the new range about to pasted.
 
Upvote 0
Code:
LastRow = Cells(Rows.Count, 1).End(xlUp).Row

will give you the last occupied row in column A. Does that help? If not, please post your code :)
 
Upvote 0
VBA For Multiple Paste

I have posted my code to facilitate what I envisioned. The caveat to this macro is that the user would have to right click and then select paste for the code to execute. Conversely, if the user did a ctrl + v then we are back at square one.

Code:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Dim EndRow As Integer
If ActiveSheet.UsedRange.Rows.Count = 0 Then
    Exit Sub
End If
EndRow = Cells(65536, 1).End(xlUp).Row
Cells(EndRow + 1, 1).Activate
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,715
Members
448,985
Latest member
chocbudda

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