Share via

Paste from web form

Anonymous
2023-04-19T14:24:32+00:00

I have a process which I copy data from a webpage and paste into a sheet. The webpage data is in a form so, I created a macro and attached to a button(shape) so I or whomever, can click it and paste values/text, rather than the entire format of the form and they don't have to right click, choose paste values/text, etc each time.

If pasted as text or values, I can manipulate and work wonders from there but, when I use the macro, it pastes either the form, or gives me an error.

What is the best method to paste using VBA when trying to accomplish this?

My first code (trial), I started off with this paste method... It pasted the entire form and everything which causes issues.

Range("B4").Select

ActiveSheet.Paste

Here is my entire second code (trial). It causes a debug on pastespecial when activated.

Sub PASTE_CONTROL()

Application.DisplayAlerts = False

Range("B4").PasteSpecial Paste:=xlPasteValues

Application.Run "FORMULATE_CONTROL_ONE"

Application.Run "FORMULATE_CONTROL"

Application.DisplayAlerts = True

End Sub

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2023-04-19T14:35:31+00:00

    Try this one.

    ActiveSheet.PasteSpecial Format:="Text"
    

    Was this answer helpful?

    0 comments No comments