Almost There...

Frith

Board Regular
Joined
Nov 1, 2009
Messages
99
Hello,

Trying this another way here... Might anyone here know how I could have the below code dump any clipboard data after the initial paste command executes? I now have it so that the already pasted cells won't take a 2nd paste... I just need to paste once per instance of copied data.

Thank you,
F

Code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, Range("A3:A50")) Is Nothing and ActiveCell = "" Then
If Target.Count < 5 Then
'Turn on error handling
On Error Resume Next
ActiveSheet.PasteSpecial NoHTMLFormatting:=True
'Check for errors
If Err Then
Err.Clear
Target.PasteSpecial xlPasteAll
If Err Then
MsgBox ("Cannot Paste." & vbCrLf & Err.Number & vbCrLf & Err.Description)
End If
End If
'Turn off error handling
Err.Clear
On Error GoTo 0
End If
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Use:
Code:
Application.CutCopyMode = False
to clear the clipboard after a paste operation.
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,134
Members
452,890
Latest member
Nikhil Ramesh

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