VBA to open Website, Copy, Paste, move down, Repeat

excellaly

New Member
Joined
Oct 31, 2020
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hello I was wondering if anyone knew how to create a VBA for this?
1. Open the website link in a new browser tab from A1
2. Copy cell B1
3. Paste the data in the open website window
4. Push enter.
5. And then repeat while moving down column B - so the 2nd time would be B2, 3rd time would be B3, and so on. Column B can be filled as far down to 30 rows but not always.
I am using google as an example in my picture because the cursor starts in the search bar as soon as you arrive to the site - just like the website I'm using.
1625095996577.png
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Do not use google as an example if that is not the site that you will be using. The answer for google will more than likely not be the answer to another website due to the HTML code used for different web sites. Please provide the website that you will be using so the people that offer help are not wasting their time.
 
Upvote 0
Do not use google as an example if that is not the site that you will be using. The answer for google will more than likely not be the answer to another website due to the HTML code used for different web sites. Please provide the website that you will be using so the people that offer help are not wasting their time.
I can't do that as the website I am using is a password protected site. Once I'm logged in I can open as many of the same tab as I want. I was just hoping there'd be a VBA function similar to me clicking/opening the link, ctrl+c, alt-tab, ctrl-v, enter repeat with ctrl+c moving down column B all the way to the bottom.
 
Upvote 0
Unfortunately it doesn't work like that in the html world of websites.
 
Upvote 0
Doubt they're looking for someone to do all the work for them. They seem to want to learn and gain ideas to get the ball rolling.

I am sure you are smart enough to figure out how to work things on your site using examples.
You can send keys from Excel to your web browser.

What browser are you using and do you have multiple fields or one as displayed on the Google screen?
If you have multiple fields right click one of the fields and select inspect.
When the inspection screen appears click the top left button. The inspect screen will highlight a string. In that string look for name=
You would use that name in your code of obj.findelementbyname ("name").sendkeys(Cells(1, 2).Value)

For google the name is q so my code would look like obj.findelementbyname ("q").sendkeys(Cells(1, 2).Value)
 
Upvote 0
Doubt they're looking for someone to do all the work for them. They seem to want to learn and gain ideas to get the ball rolling.

I am sure you are smart enough to figure out how to work things on your site using examples.
You can send keys from Excel to your web browser.

What browser are you using and do you have multiple fields or one as displayed on the Google screen?
If you have multiple fields right click one of the fields and select inspect.
When the inspection screen appears click the top left button. The inspect screen will highlight a string. In that string look for name=
You would use that name in your code of obj.findelementbyname ("name").sendkeys(Cells(1, 2).Value)

For google the name is q so my code would look like obj.findelementbyname ("q").sendkeys(Cells(1, 2).Value)
Yes I was planning on using the replies as a guide and filling in the rest on my own.
1. I am using chrome
2. There is only 1 field which the cursor already sits on.
 
Upvote 0
Yes I was planning on using the replies as a guide and filling in the rest on my own.
1. I am using chrome
2. There is only 1 field which the cursor already sits on.
I recommend seeing mrexcel.com/board/threads/copy-data-from-excel-cells-to-google-chrome-vba.731751
 
Upvote 0
Their code may not fully fit what you want must I've tested part of it and it does work. Hopefully that will help get you going. An alternative outside of Excel would be AutoHotKeys but that's a whole different language to learn.
 
Upvote 0
Their code may not fully fit what you want must I've tested part of it and it does work. Hopefully that will help get you going. An alternative outside of Excel would be AutoHotKeys but that's a whole different language to learn.
Using send keys worked! Thank you!
 
Upvote 0

Forum statistics

Threads
1,215,734
Messages
6,126,543
Members
449,316
Latest member
sravya

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