LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default QueryTable Questions

Hi,

I inherited a spreadsheet with a VBA module. This module updates financial
data from various websites. Below is the code.

I don't understand how "Selection.QueryTable.Refresh BackgroundQuery:=False"
updates the spreadsheet. Or put differently, I have no knowledge of
"QueryTable". Can someone point me to how the code below updates the
spreadsheet.

In looking at the spreadsheet, I didn't see any links the websites of
interest. So I am curious as to how this code works, and how it knows what
to fetch and where to fetch the data from the external websites.

Thank you.

HS



Sub Update_IntRates()

Set CurrentSheet = ActiveCell.Worksheet
Dim LRVisible As Integer

'
If Sheets("Mystery").Visible = False Then
LRVisible = 1
Sheets("Mystery").Visible = True
Else
LRVisible = 0
End If

'Prepare to Refresh Data
'
Sheets("Mystery").Select

'
Range("A57").Select
Application.StatusBar = "Updating Rates (Site 1 of 3)...Please Wait"
Selection.QueryTable.Refresh BackgroundQuery:=False

'Update 1 and 10 year FactorX Rates
'

'Copy timestamp
Application.StatusBar = "Applying Changes to Model...Please Wait"
Range("R2").Copy
Range("ratedate2").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


'Prepare to update history
Range("U3:Y3").Select
Selection.Insert Shift:=xlDown

'Insert Date
Range("ratedate2").Copy
Range("U3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

'Update 3 month FactorX history
Range("FactorX_3mo").Copy
Range("V3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

'Update 1 year FactorX history
Range("FactorX_1yr").Copy
Range("W3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

'Update 10 year FactorX history
Range("FactorX_10yr").Copy
Range("X3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

CurrentSheet.Activate
Application.StatusBar = False
End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Answers to questions posing more questions in a workbook sbelle1 Excel Worksheet Functions 2 August 8th 09 01:02 AM
View Questions and Answer to questions I created Roibn Taylor Excel Discussion (Misc queries) 4 July 24th 08 12:05 AM
Querytable range name Ray[_12_] Excel Programming 0 September 13th 04 08:29 PM
How to use QueryTable with insertion sql ou Excel Programming 1 August 18th 04 12:20 PM
Querytable Ben.c Excel Programming 4 December 3rd 03 09:11 AM


All times are GMT +1. The time now is 08:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"