![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Location: Memphis
Posts: 12
|
I have a macro in which I want to include a code to halt or freeze the steps for 15 seconds then continue without any user intervention. Excel help wasn't that helpful. This is as far as I have made it:
Sub Viewit() ' ' Macro ' ' Application.ScreenUpdating = False Sheets("View").Visible = True Sheets(Array("FinalReport", "Alloc Rates", "Variances", "Misc")).Select Sheets("FinalReport").Activate ActiveWindow.SelectedSheets.Visible = False Sheets("View").Select ActiveWindow.Zoom = 200 Application.ScreenUpdating = False With ActiveWindow .DisplayGridlines = False .DisplayHeadings = False End With Application.ScreenUpdating = True 'I want to pause the script for 15 seconds at this point Application.ScreenUpdating = False With ActiveWindow .DisplayGridlines = True .DisplayHeadings = True End With Application.ScreenUpdating = True ActiveWindow.Zoom = 100 Sheets("View").Visible = True Sheets("Misc").Visible = True Sheets("Variances").Visible = True Sheets("Alloc Rates").Visible = True Sheets("FinalReport").Visible = True Sheets("View").Select ActiveWindow.SelectedSheets.Visible = False Application.Goto Reference:="Go2BUTTONS" Application.ScreenUpdating = True End Sub |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Location: Redmond, WA
Posts: 636
|
Use the timer control.
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Apr 2002
Location: Greenwood, SC
Posts: 677
|
Put this in your code to get a 15 second pause:
newHour = Hour(Now()) newMinute = Minute(Now()) newSecond = Second(Now()) + 15 waitTime = TimeSerial(newHour, newMinute, newSecond) Application.Wait waitTime |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|