A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Refresh some not Refresh All



 
 
Thread Tools Display Modes
  #1  
Old May 12th, 2010, 04:21 PM posted to microsoft.public.excel.misc
PBISMaryland
external usenet poster
 
Posts: 32
Default Refresh some not Refresh All

Hello. I have a workbook with 10 sheets all of which have external data that
needs to be refreshed periodically. Most of the time I only need to refresh
8 of the sheets. Is there a way to refresh just those 8 without having to
refresh each one separately?
Thanks in advance.
  #2  
Old May 12th, 2010, 06:16 PM posted to microsoft.public.excel.misc
Jim Thomlinson
external usenet poster
 
Posts: 2,641
Default Refresh some not Refresh All

You can use a macro to do it. It would go something like this...

Sub RefreshSome()
Dim wks As Worksheet
Dim qt As QueryTable

For Each wks In Worksheets
Select Case wks.Name
Case "Sheet1", "sheet2"
Case Else
For Each qt In wks.QueryTables
qt.Refresh
Next qt
End Select
Next wks

End Sub

the above will refresh all querytables in all sheets excpet for sheet1 and
sheet2
--
HTH...

Jim Thomlinson


"PBISMaryland" wrote:

Hello. I have a workbook with 10 sheets all of which have external data that
needs to be refreshed periodically. Most of the time I only need to refresh
8 of the sheets. Is there a way to refresh just those 8 without having to
refresh each one separately?
Thanks in advance.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:45 PM.


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