Hello
I am trying to run the following off a button on a userform. If I progress it one step at a time it works but if I run it from the button it stops at
Workbooks("DEFG Macro plus.xls").Sheets("Sheet1").Activate
I think it might be running too fast but haven't a clue how to insert a pause between steps
[vba]Private Sub ABCDSortedView_Click()
Workbooks("Search tool2Southall.xls").Close
Workbooks("DEFG Macro plus.xls").Sheets("Sheet1").Activate
ActiveWindow.WindowState = xlMinimized
Application.Run "'DEFG Macro plus.xls'!DEFGFiltering2"
Options.Hide
End Sub[/VBA]
I did try this off the net but coudn't get it to work.I don't know if I was barking up the wrong tree or just barking.
Expand|Select|Wrap|Line Numbers
- [VBA]
[/VBA]Then put this where you want to wait:
- Option Compare Database
- Option Explicit
- Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
[vba]
This waits 10 seconds before moving to the next line
- Sleep (10000)[/vba]
Obviously I don't want it to wait that long but it was a try.
All help gratefully acknowledged in advance.
Gil