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

zero269

Active Member
Joined
Jan 16, 2023
Messages
253
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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,633
Latest member
DougMo

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