I want to create a macro that takes the row number of the active cell and copies it to the clipboard.
When I execute the following code I get 'compile error: invalid qualifier'.
I have forgotten most of my VBA but surely something this simple should work? Thanks in advance for any help you can offer.
Sub macro3()
Dim x As Integer
x = ActiveCell.row
x.Copy
End Sub
EDIT: Using the solution below, I changed it to the following (which works):
After first adding a reference to Microsoft Forms 2.0 Object Library under Tools > References in the VBE:
Sub macro3()
Dim x As DataObject
Set x = New DataObject
x.settext ActiveCell.row
x.putinclipboard
End Sub