VBA for multiple paste

Slicemahn

Board Regular
Joined
Jun 10, 2004
Messages
102
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.
 

Some videos you may like

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
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?
 

Slicemahn

Board Regular
Joined
Jun 10, 2004
Messages
102
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.
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
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 :)
 

Slicemahn

Board Regular
Joined
Jun 10, 2004
Messages
102
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
 

Watch MrExcel Video

Forum statistics

Threads
1,123,125
Messages
5,599,856
Members
414,342
Latest member
K Darrell Smith

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
Top