Clipboard erased after running macro

ttratl

Board Regular
Joined
Dec 21, 2004
Messages
168
This is annoying:
I copy stuff from one sheet, go to another sheet, run this simple macro to reset filtered lists:
Code:
Sub ResetFilteredLists()
    On Error Resume Next
    ActiveSheet.ShowAllData
    Range("B2").Select
    End Sub
then try to Paste, and the macro has cleared the clipboard.

Any ideas how to stop this?

it doesn't happen with this macro:
Code:
Sub nextavailablerow()
    Range("b65536").End(xlUp).Offset(1, 0).Select
End Sub

so I'm puzzled....
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Ok so used bits of these macros to make it work
Code:
public strClip as String

Private Sub getClipboard()
    Dim MyData As DataObject

    On Error Reumse Next
    Set MyData = New DataObject
    MyData.GetFromClipboard
    strClip = MyData.GetText
End Sub

Private Sub setClipboard()
    Dim MyData As DataObject

    On Error Resume Next
    Set MyData = New DataObject
    MyData.SetText strClip
    MyData.PutInClipboard

End Sub
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

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