VBA: Paste from Clipboard to Active Cell (then TAB key)

zero269

Board Regular
Joined
Jan 16, 2023
Messages
219
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm having trouble pasting from the Windows Clipboard into the Active Cell in Excel.

I've tried a few variations online but none of them work.

The one that looks like the simplest is:

VBA Code:
Sub PasteValues()
ActiveSheet.PasteSpecial Paste:=xlPasteValues
End Sub

However, this throws a run-time error '1004'

1674792172791.png


NOTE: I'm copying a value from a web page and trying to just Paste it into the active cell.
I'd like to Tab (key) which should move to the next row in my case within the Table.

Microsoft's information on Worksheet.Paste method is not very helpful. Their EXAMPLE:
VBA Code:
Worksheets("Sheet1").Range("C1:C5").Copy
ActiveSheet.Paste Destination:=Worksheets("Sheet1").Range("D1:D5")
I'm not using their COPY line because I'm trying to PASTE from the Clipboard, and they indicate the Destination is optional and that it defaults to the active selection.

1674792865524.png

Thank you...


1674792994190.png
 
Haha, well this is a "feeder" sheet for me. I am trying to copy data from a table on a website to ActiveCell A2 where it will create multiple worksheets based on values in column H and copy/paste the relevant rows to each worksheet. There's always more than one way to do something so hopefully somebody comes along to enlighten us :)
Not sure if this will help you specifically, but worth testing out perhaps...
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,215,256
Messages
6,123,915
Members
449,132
Latest member
Rosie14

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top