Even though i can write little bit VB code, I am relative beginner, hence i would like if someone could help me with this.
I have set up a perfect loop, that changes cell values from named table
here is code:
now what i want is, i have set up a Web-Query that will take value for URL from the B4 and will get me the data.
How can I import/use the saved ".iqy file" inside above VBA code to take value from B4 as URL, OR
Have a web-query run to get data with B4 as URL
A sample dataset:
<tbody>
</tbody>
I have set up a perfect loop, that changes cell values from named table
here is code:
Code:
Sub LoopThroughForEachCellInARange()
Dim OutputAddress As String
Dim rng As Range: Set rng = Application.Range("subIDType") 'value for B2
Dim cell As Range
Dim rng2 As Range: Set rng2 = Application.Range("mainID") 'value for B1
Dim cel2 As Range
For Each cel2 In rng2.Cells
With cel2
'Debug.Print .Value
Worksheets("sheet1").Select
Worksheets("sheet1").Range("B1") = .Value
For Each cel In rng.Cells
With cel
'Debug.Print .Value
Worksheets("sheet1").Select
Worksheets("sheet1").Range("B2") = .Value
End With
Next cel
End With
Next cel2
End Sub
now what i want is, i have set up a Web-Query that will take value for URL from the B4 and will get me the data.
How can I import/use the saved ".iqy file" inside above VBA code to take value from B4 as URL, OR
Have a web-query run to get data with B4 as URL
A sample dataset:
A | B | C | |
1 | mainID | Value will be taken from named table | From VBA |
2 | subIDType | Value will be taken from named table | From VBA |
3 | coreID | Vlookup Formula to look for corresponding coreID with ref to mainID | Formula |
4 | Concatenate | Concatenate Formula that will combine 1,2,3 to form URL | Formula |
<tbody>
</tbody>