vba to clipboard
Function Clipboard(Optional StoreText As String) As String 'PURPOSE: Read/Write to Clipboard 'Source: ExcelHero.com (Daniel Ferry) Dim x As Variant 'Store as variant for 64-bit VBA support x = StoreText 'Create HTMLFile Object With CreateObject("htmlfile") With .parentWindow.clipboardData Select Case True Case Len(StoreText) 'Write to the clipboard .setData "text", x Case Else 'Read from the clipboard (no variable passed through) Clipboard = .GetData("text") End Select End With End With End Function