Created
November 26, 2013 03:40
-
-
Save zhimiaoli/7653139 to your computer and use it in GitHub Desktop.
要插入行或列前有时需要清空剪贴板
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Declare Function OpenClipboard Lib "user32" (ByVal Hwnd As Long) As Long | |
Private Declare Function CloseClipboard Lib "user32" () As Long | |
Private Declare Function EmptyClipboard Lib "user32" () As Long | |
'''''''''''''' | |
'这个宏的功能是清空剪贴板,当复制东西的时候,然后要插入什么,不能单纯的插入,只能插入复制的内容 | |
'这个宏就是清空剪贴板,让你可以插入空白 | |
'清空剪贴板,需要上面的声明。 | |
'参考http://club.excelhome.net/forum.php?mod=redirect&goto=findpost&ptid=767916&pid=5233159 | |
'''''''''''''' | |
Sub clearClipboard() | |
If (OpenClipboard(0&)) Then | |
Call EmptyClipboard | |
Call CloseClipboard | |
End If | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment