guilhermepa
New Member
- Joined
- Jun 19, 2022
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
I need to paste text from windows clipboard on an excel sheet using vba
Vba will paste the content from clipboard on a cell address given informed as value on a certain cell from excel
Example: cell H10 on excel contains the column value of F
Cell K20 on excel contains the row value of 40
Sub test ()
Dim column As string ' tried as integer too by converting excell column into a number but did not work
Dim row As integer
column = Cells(1,2).value ' supposing the column value is given on that specified addrress
row = Cells(5,6).value ' supposing the row value is given on that specified addrress
Worksheets("worksheet_name").cells(column,row).PasteSpecial ' it is going to paste a text from clipboard
End sub
It gives me error 1004
Vba will paste the content from clipboard on a cell address given informed as value on a certain cell from excel
Example: cell H10 on excel contains the column value of F
Cell K20 on excel contains the row value of 40
Sub test ()
Dim column As string ' tried as integer too by converting excell column into a number but did not work
Dim row As integer
column = Cells(1,2).value ' supposing the column value is given on that specified addrress
row = Cells(5,6).value ' supposing the row value is given on that specified addrress
Worksheets("worksheet_name").cells(column,row).PasteSpecial ' it is going to paste a text from clipboard
End sub
It gives me error 1004