Double click Copy / Paste to Website

neilholmes

New Member
Joined
Feb 17, 2011
Messages
13
Morning all,

I am hoping that someone will be able to help me with this complicated code I am trying to complete.

History:
I have created a workbook that goes to a website extracts data and sorts this for my clients. The content of the document pulls in financial information regarding investment funds and shows the user the best available fund matching a set of specific criteria.

I have now been asked to look into the posibility of the following.

One of the columns that is pulled into the spreadsheet is a 'reference' that identifies the fund. If the user takes this code and pastes it back into a search field on the original website, the fund will then be added to a list for further analysis.

What I would like to achieve:

I would ideally like a macro that,

1 - When the user 'double clicks' on the cell that contains the reference, the reference number is copied to clipboard. (These are listed in Column R)

2 - Once copied, the url for the website is opened, and the user is automatically logged in based on their user id.

3 - The code is then pasted into the correct field on the site and the fund for the code is then added to the pick list. *

* on the site I believe the search field is called "_FundSearch" this being the area the reference need to be pasted into. There is then a button that searches for the result, which I believe is: <ahref="javascript:void(0);" *******="goFundSearch(ge('_FundSearch'));" title="fund search">

<FONT color=#0000ff>Once the search is complete I believe the following adds the selected to the list: ;<a href="javascript:addInstrumentClient('F', ge('ListFund')); void(0);">add</a>

(I can play around with these fields to get the correct one)


Obviously this is complicated and I am unable to show you the login information for the site due to security. However I do have the following code (that works) to open the url and log the user into the account:

Code:
Sub AUTO_Login()
 
Application.ScreenUpdating = False
 
    Dim IE As Object
    Set IE = CreateObject("InternetExplorer.application")
    With IE
        .Visible = True
        .navigate ([URL]http://www.example.com[/URL])
        While .Busy Or .ReadyState <> 4: DoEvents: Wend
        .document.all("txtGroup").Value = "groupname"
        .document.all("txtUser").Value = "username"
        .document.all("txtPassword").Value = "userpassword"
        .document.all("btnAction").Click
        While .Busy Or .ReadyState <> 4: DoEvents: Wend
        Debug.Print .LocationURL
    End With
 
Application.ScreenUpdating = True
 
End Sub


I therefore need help completing the copy/paste element of the code.

Additionally. It would also be extremely helpful if the code could identify if the login process has already been complete. So, for example if the user double clicks on a second 'reference number' the vb code does not try log them in a second time.

I understand that this is complex and may not be possible via vb, but any help anyone could offer would be greatly appreciated.... Or if anyone is looking for a challenge !

icon10.gif


- Neil
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,224,592
Messages
6,179,789
Members
452,942
Latest member
VijayNewtoExcel

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