View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Make my vba wait?

Try this

'refresh query
DoEvents

"Emma Hope" wrote:

Hi all,

I have a VBA query which refreshes a workbook and then saves it, then it
changes a particular cell value and then saves it somewhere else.

Unfortunately, the first save hasn't finished before it changes the
particular cell value, so the first save is incorrect.

How can i make the vba understand i want it to wait until the previous line
of code has finished before starting the next bit?

Thanks
Emma