Doug Blackwell
New Member
- Joined
- Apr 13, 2008
- Messages
- 18
The more I think about this the more confused I get.
I have a hidden worksheet that I want users to paste data onto using a button on a main interface worksheet. The data they are pasting will come from their own worksheet which will have indeterminate names, so the button simply uses sheet1.range("a1").PasteSpecial command. However, if they've forgotten to copy (perhaps merely selected), it will give an error. I can error-check on my worksheet if they've copied the wrong data, but not if they copied nothing at all!
So the question becomes, is there any method in VBA to determine if they have copied anything to the clipboard before it gets to the paste command in my code? I'd rather do this check first, than solve it by error trapping, but maybe that's the only solution.
The more I thought about it, the less I realized I understood. Does anyone know whether the vba copy command (Range("a1").copy) is exactly equivalent to copying to the clipboard? Therefore, is PasteSpecial accessing a Windows object and not an Excel object? Before I thought about it I'd assumed "copy" in VBA was independent of the Windows clipboard.
Any help, understanding or direction would be welcome,
Doug.
I have a hidden worksheet that I want users to paste data onto using a button on a main interface worksheet. The data they are pasting will come from their own worksheet which will have indeterminate names, so the button simply uses sheet1.range("a1").PasteSpecial command. However, if they've forgotten to copy (perhaps merely selected), it will give an error. I can error-check on my worksheet if they've copied the wrong data, but not if they copied nothing at all!
So the question becomes, is there any method in VBA to determine if they have copied anything to the clipboard before it gets to the paste command in my code? I'd rather do this check first, than solve it by error trapping, but maybe that's the only solution.
The more I thought about it, the less I realized I understood. Does anyone know whether the vba copy command (Range("a1").copy) is exactly equivalent to copying to the clipboard? Therefore, is PasteSpecial accessing a Windows object and not an Excel object? Before I thought about it I'd assumed "copy" in VBA was independent of the Windows clipboard.
Any help, understanding or direction would be welcome,
Doug.