View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default How do I pause a macro?

hi
sounds like you have background refresh enabled.
i'm assuming that you are using microsoft query and that you are running a
macro to refresh.
1. Right click the query, click properties. uncheck "enable baground refresh"
2. and this line to the macro
Selection.QueryTable.Refresh BackgroundQuery:=False

this way MSQ wil retrieve all data before the macro starts formating.

Regards
FSt1
"Dave H" wrote:


I have a spreadsheet that has links to outside sources. I have a macro
that formats the sheet based on the info retrieved. When I try a
refresh all then format. It formats before the new data is received.
It might take 5 seconds or it might take 2 minutes to refresh. Is
there a way to pause a macro until the refresh is complete?




--
Dave H