LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default populating excel cells with data from data sources

Where will your actual query reside? MSQuery maybe. Do you want to do
it all in VBA or just use VBA to trigger the data to refresh?

i.e. do you want to create a report written in VBA and return the data
to a number of single cells, or just use vba to refresh the data that's
already there?

The latter is by far the easiest, something like

Sub RefreshMyData()
Dim myRange as Range
Set myRange = Range("B54") 'wherever you have data
myRange.QueryTable.Refresh
End Sub

or perhaps:

Sub RefreshMyData()
Dim i as integer
For i = 1 to 13 'however many separate data queries you have
Sheets("My Sheet").Querytables(i).Refresh
Next i
End Sub

Whereas creating the queries in VBA is a whole load more work!

 
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
Excel Data Sources KnockOffNigel Charts and Charting in Excel 1 December 29th 08 10:48 AM
Merged cells and formula data sources radellaf Excel Discussion (Misc queries) 10 August 23rd 07 10:43 PM
Two Excel Data Sources Stephanie Excel Discussion (Misc queries) 1 February 5th 07 02:07 PM
Excel VBA & ODBC Data Sources Tim Allen Excel Programming 3 December 27th 04 07:11 PM
Populating blank cells with the data in the cell above. Frank Kabel Excel Programming 0 August 2nd 04 04:23 PM


All times are GMT +1. The time now is 10:04 PM.

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"