Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 414
Default External Data Refresh all just for one worksheet

I have a worksheet with multiple external queries linked to Access. I want a
user to be able to refresh all external data, but just within this one
spreadsheet and not across the whole file.

Is there any VBA that I can put behind a button just to refresh all queries
within this one worksheet?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default External Data Refresh all just for one worksheet

hi
the multiple MSQ's might be a problem. there is the refreshall command but
it can create problems if you have more that 2 or 3 for that it allows a
background refresh meaning you can continue working while the refresh is in
progress. sometimes the data don't refresh fast enough so i have never
recomended to allow a background refresh even for a single MSQ.
instead what i would do is select the upper left cell of the MSQuery range
of each query and refresh each individually.

sub refre****()
Sheets("sheet1").activate 'change if needed
range("A1").QueryTable.Refresh BackgroundQuery:=False
'need above line for each MSQ on the sheet
Msgbox "Refresh complete."
end sub

the above code can be attached to a command button or toolbar icon. i
recomend the command button because the button follows the file.

regards
FSt1

"Andy" wrote:

I have a worksheet with multiple external queries linked to Access. I want a
user to be able to refresh all external data, but just within this one
spreadsheet and not across the whole file.

Is there any VBA that I can put behind a button just to refresh all queries
within this one worksheet?

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default External Data Refresh all just for one worksheet

hi
forgot to mention. see this site on getting started.
http://www.mvps.org/dmcritchie/excel/getstarted.htm

regards
FSt1

"Andy" wrote:

I have a worksheet with multiple external queries linked to Access. I want a
user to be able to refresh all external data, but just within this one
spreadsheet and not across the whole file.

Is there any VBA that I can put behind a button just to refresh all queries
within this one worksheet?

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 414
Default External Data Refresh all just for one worksheet

Excellent, works great, thanks

"FSt1" wrote:

hi
the multiple MSQ's might be a problem. there is the refreshall command but
it can create problems if you have more that 2 or 3 for that it allows a
background refresh meaning you can continue working while the refresh is in
progress. sometimes the data don't refresh fast enough so i have never
recomended to allow a background refresh even for a single MSQ.
instead what i would do is select the upper left cell of the MSQuery range
of each query and refresh each individually.

sub refre****()
Sheets("sheet1").activate 'change if needed
range("A1").QueryTable.Refresh BackgroundQuery:=False
'need above line for each MSQ on the sheet
Msgbox "Refresh complete."
end sub

the above code can be attached to a command button or toolbar icon. i
recomend the command button because the button follows the file.

regards
FSt1

"Andy" wrote:

I have a worksheet with multiple external queries linked to Access. I want a
user to be able to refresh all external data, but just within this one
spreadsheet and not across the whole file.

Is there any VBA that I can put behind a button just to refresh all queries
within this one worksheet?

Thanks

Reply
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
Automatic refresh of external data Rick Excel Worksheet Functions 1 May 26th 08 06:41 PM
Create refresh button in worksheet to refresh Pivot Table Data Ron Excel Worksheet Functions 1 October 13th 07 01:20 AM
External data refresh Texas Tonie[_2_] Excel Discussion (Misc queries) 1 April 17th 07 11:02 AM
external data refresh shoreguy Excel Discussion (Misc queries) 0 March 7th 06 06:30 PM
External Data Refresh not working Mike B in VT Excel Discussion (Misc queries) 0 February 10th 06 06:23 PM


All times are GMT +1. The time now is 03:24 PM.

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

About Us

"It's about Microsoft Excel"