user7755666
user7755666

Reputation:

HTML VBA modification URL

I'm trying to modify a link "URL link" using VBA Excel to extract specific Value from Site .

Below the Type of link :

URLhttp://Confidential.eu.airbus.Confidential:Confidential/Confidential/consultation/preViewMP.do?mpId=XXXXXX

What I want is to change mpID=XXXXX with sheet("Feuil1").range("A1").valuebut I didn't succeed , I don't have the right knowledge

So I don't have a clue how to manipulate this URL to open what I enter in range("A1") and look for specific line there and Copy and Past it in my excel File

Anyone could light me with some idea or help to better code this ?

Upvotes: 0

Views: 98

Answers (1)

Wolfie
Wolfie

Reputation: 30046

You can get the string from A1 using

Dim str As String: str = ThisWorkbook.Sheets("Feuil1").Range("A1").Value

Then create the URL from what you've stated

Dim myURL as String
' The & symbol concatenates strings. The _ symbol is for line continuation.
myURL = "http://Confidential.eu.airbus.Confidential:Confidential/Confidential/" _
        & "consultation/preViewMP.do?" & str

Upvotes: 1

Related Questions