score:3
Sub UseDynamicURL()
Dim wb As Workbook
Dim src As Worksheet
Dim tgt As Worksheet
Set wb = ThisWorkbook
Set src = wb.Sheets("Sheet1")
Set tgt = wb.Sheets("Sheet2")
Dim url As String
Dim symbol As String
symbol = src.Range("A1")
url = "URL;http://finance.yahoo.com/q/is?s="
url = url & symbol & "+Income+Statement&annual"
With tgt.QueryTables.Add(Connection:= _
url, _
Destination:=tgt.Range("A1"))
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
End Sub
Source: stackoverflow.com
Related Articles
- Create dynamic url using value from cell
- Copying the cell value preserving the formatting from one cell to another in excel using VBA
- How do I get the cell value from a formula in Excel using VBA?
- How to I change a value of a cell in an Excel worksheet from MS Access using VBA?
- Using dynamic "<" or ">" from cell result within an If statement
- Using excel VBA open file based on cell value with path composed on the fly from same value
- Create new Sheet for each cell in Range and rename using its value
- Create A popup InputBox from a cell and right the value to the next one
- Get value of a merged cell of an excel from its cell address in vba
- Select first empty cell in column F starting from row 1. (without using offset )
- How to highlight a cell using the hex color value within the cell?
- Set a cell value from a function
- Excel VBA - read cell value from code
- Get a text value from a form in Access using a VBA module
- Fill non-contiguous blank cells with the value from the cell above the first blank
- Get Value from a cell on a worksheet
- How do I find the fill colour value of a conditionally formatted cell in Excel 2007 using vba?
- VBA for clear value in specific range of cell and protected cell from being wash away formula
- Split data into multiple workbooks based on cell value in Excel using vba
- Using another cell value to reference a range
- Find a value from a column and quickly return the row number of its cell
- How to display value from cell in vba code?
- Create variant array using Text instead of Value
- VBA getting the value of the cell from which a hyper link was clicked
- How to change cell value using Worksheet_change event without triggering a second call
- Using VBA to create a dynamic table in Access 2010
- How do I Insert a String That Starts With = Into a Cell Value Using VBA?
- Copy background color from one cell to cell in separate sheet using ms-excel?
- VBA | How to Copy value from Cell to Cell in Excel
- Excel vba: Is it possible to access the value of a cell before the UDF called from that cell executes?
- VBA Looping Through Folder Formula Pasting Issue
- How to process multibyte symbols in MS Word VBA
- Select code snippet in document, using the VBA
- VBA - Check if named range is hidden. If not hidden, AutoFit cell Row height
- Getting VBA Function to auto update when a change is made on sheet - excel
- VBA Error Handler with "With" Statement
- Save record in subform
- How to add ROUND() in every cell of selection, but
- How to disable the MS Word "macro-free document" warning with code?
- Excel VBA Combine duplicate rows and add quantities
- IE11 Frame Notification Bar Save button
- Run Function down column in Excel VBA
- Excel column number from column name
- Showing hidden column in another sheet
- Adapt label width to text
- EXCEL VBA: Copy Sheet from a workbook to another workbook in different location
- Trying to show only a certain amount of numbers
- Is there an Alternative to using the LoadPicture("bmp_or_icon_file_path") to loading Images in Excel 2007 VBA
- VBA: Cut a range of columns and paste it as one column
- How do I slice an array in Excel VBA?