Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Re: vbscript pause

Reply
 
Old 05-31-2008   #1 (permalink)
Chongy


 
 

Re: vbscript pause


Hi ,I am trying to set a macro in Excel, when I do this, the macro runs
fine, but it does everything so quickly, you cannot see what is going on. Is
there a way that I can put a pause in there so that you can see each stage
that the macro is going through? So what I want to do, is run the macro, and
then after each End with or End sub i need to be able to put a pause in there.

My code is:



Private Sub Timer1_Timer()
CurrentSecond = CurrentSecond + 2
If CurrentSecond = TimeLimit Then
Timer1.Enabled = False
End Sub
Private Sub Form_Load()
CurrentSecond = 0
TimeLimit = 1
End With
With ActiveChart.PivotLayout.PivotTable.DataPivotField
.Orientation = xlColumnField
.Position = 1
End With
With ActiveChart.PivotLayout.PivotTable.PivotFields("Club member")
.Orientation = xlColumnField
.Position = 1
End With
End Sub



Sub Macro4()
'
' Macro4 Macro
' Macro recorded 31/05/2008 by z
'

'
With ActiveChart.PivotLayout.PivotTable.PivotFields("Club member")
.Orientation = xlColumnField
.Position = 1
End With
With ActiveChart.PivotLayout.PivotTable.DataPivotField
.Orientation = xlColumnField
.Position = 1
End With
With ActiveChart.PivotLayout.PivotTable.PivotFields("Customer type")
.Orientation = xlColumnField
.Position = 1
End With
End Sub


Thanks


My System SpecsSystem Spec
Old 05-31-2008   #2 (permalink)
Pegasus \(MVP\)


 
 

Re: vbscript pause


"Chongy" <Chongy@xxxxxx> wrote in message
news:8F97837B-1889-462F-AB59-7CD4DA5096F1@xxxxxx
Quote:

>
> Hi ,I am trying to set a macro in Excel, when I do this, the macro runs
> fine, but it does everything so quickly, you cannot see what is going on.
> Is
> there a way that I can put a pause in there so that you can see each stage
> that the macro is going through? So what I want to do, is run the macro,
> and
> then after each End with or End sub i need to be able to put a pause in
> there.
>
> My code is:
>
>
>
> Private Sub Timer1_Timer()
> CurrentSecond = CurrentSecond + 2
> If CurrentSecond = TimeLimit Then
> Timer1.Enabled = False
> End Sub
> Private Sub Form_Load()
> CurrentSecond = 0
> TimeLimit = 1
> End With
> With ActiveChart.PivotLayout.PivotTable.DataPivotField
> .Orientation = xlColumnField
> .Position = 1
> End With
> With ActiveChart.PivotLayout.PivotTable.PivotFields("Club member")
> .Orientation = xlColumnField
> .Position = 1
> End With
> End Sub
>
>
>
> Sub Macro4()
> '
> ' Macro4 Macro
> ' Macro recorded 31/05/2008 by z
> '
>
> '
> With ActiveChart.PivotLayout.PivotTable.PivotFields("Club member")
> .Orientation = xlColumnField
> .Position = 1
> End With
> With ActiveChart.PivotLayout.PivotTable.DataPivotField
> .Orientation = xlColumnField
> .Position = 1
> End With
> With ActiveChart.PivotLayout.PivotTable.PivotFields("Customer type")
> .Orientation = xlColumnField
> .Position = 1
> End With
> End Sub
>
>
> Thanks
>
Try this while in Excel:
- Open your macro for editing.
- Click Help
- In the search field, type "Pause" (without the double quotes)
- Follow the suggestions


My System SpecsSystem Spec
Old 05-31-2008   #3 (permalink)
hb21l6


 
 

Re: vbscript pause


"Pegasus (MVP)" <I.can@xxxxxx> wrote in message
news:uCe9TwvwIHA.1772@xxxxxx
Quote:

>
> "Chongy" <Chongy@xxxxxx> wrote in message
> news:8F97837B-1889-462F-AB59-7CD4DA5096F1@xxxxxx
Quote:

>>
>> Hi ,I am trying to set a macro in Excel, when I do this, the macro runs
>> fine, but it does everything so quickly, you cannot see what is going on.
>> Is
>> there a way that I can put a pause in there so that you can see each
>> stage
>> that the macro is going through? So what I want to do, is run the macro,
>> and
>> then after each End with or End sub i need to be able to put a pause in
>> there.
>>
>> My code is:
>>
>>
>>
>> Private Sub Timer1_Timer()
>> CurrentSecond = CurrentSecond + 2
>> If CurrentSecond = TimeLimit Then
>> Timer1.Enabled = False
>> End Sub
>> Private Sub Form_Load()
>> CurrentSecond = 0
>> TimeLimit = 1
>> End With
>> With ActiveChart.PivotLayout.PivotTable.DataPivotField
>> .Orientation = xlColumnField
>> .Position = 1
>> End With
>> With ActiveChart.PivotLayout.PivotTable.PivotFields("Club member")
>> .Orientation = xlColumnField
>> .Position = 1
>> End With
>> End Sub
>>
>>
>>
>> Sub Macro4()
>> '
>> ' Macro4 Macro
>> ' Macro recorded 31/05/2008 by z
>> '
>>
>> '
>> With ActiveChart.PivotLayout.PivotTable.PivotFields("Club member")
>> .Orientation = xlColumnField
>> .Position = 1
>> End With
>> With ActiveChart.PivotLayout.PivotTable.DataPivotField
>> .Orientation = xlColumnField
>> .Position = 1
>> End With
>> With ActiveChart.PivotLayout.PivotTable.PivotFields("Customer type")
>> .Orientation = xlColumnField
>> .Position = 1
>> End With
>> End Sub
>>
>>
>> Thanks
>>
>
> Try this while in Excel:
> - Open your macro for editing.
> - Click Help
> - In the search field, type "Pause" (without the double quotes)
> - Follow the suggestions
I've never done it in Excel, but you need a timer.
let it run and check for a variable status every second until the condition
is true, then execute the next part of the code.

My System SpecsSystem Spec
Old 05-31-2008   #4 (permalink)
Pegasus \(MVP\)


 
 

Re: vbscript pause


"hb21l6" <hb21l6@xxxxxx> wrote in message
news:28076D8B-9D90-446E-A6C1-DFC60B2DE24A@xxxxxx
Quote:

>
> "Pegasus (MVP)" <I.can@xxxxxx> wrote in message
> news:uCe9TwvwIHA.1772@xxxxxx
Quote:

>>
>> "Chongy" <Chongy@xxxxxx> wrote in message
>> news:8F97837B-1889-462F-AB59-7CD4DA5096F1@xxxxxx
Quote:

>>>
>>> Hi ,I am trying to set a macro in Excel, when I do this, the macro runs
>>> fine, but it does everything so quickly, you cannot see what is going
>>> on. Is
>>> there a way that I can put a pause in there so that you can see each
>>> stage
>>> that the macro is going through? So what I want to do, is run the
>>> macro, and
>>> then after each End with or End sub i need to be able to put a pause in
>>> there.
>>>
>>> My code is:
>>>
>>>
>>>
>>> Private Sub Timer1_Timer()
>>> CurrentSecond = CurrentSecond + 2
>>> If CurrentSecond = TimeLimit Then
>>> Timer1.Enabled = False
>>> End Sub
>>> Private Sub Form_Load()
>>> CurrentSecond = 0
>>> TimeLimit = 1
>>> End With
>>> With ActiveChart.PivotLayout.PivotTable.DataPivotField
>>> .Orientation = xlColumnField
>>> .Position = 1
>>> End With
>>> With ActiveChart.PivotLayout.PivotTable.PivotFields("Club member")
>>> .Orientation = xlColumnField
>>> .Position = 1
>>> End With
>>> End Sub
>>>
>>>
>>>
>>> Sub Macro4()
>>> '
>>> ' Macro4 Macro
>>> ' Macro recorded 31/05/2008 by z
>>> '
>>>
>>> '
>>> With ActiveChart.PivotLayout.PivotTable.PivotFields("Club member")
>>> .Orientation = xlColumnField
>>> .Position = 1
>>> End With
>>> With ActiveChart.PivotLayout.PivotTable.DataPivotField
>>> .Orientation = xlColumnField
>>> .Position = 1
>>> End With
>>> With ActiveChart.PivotLayout.PivotTable.PivotFields("Customer type")
>>> .Orientation = xlColumnField
>>> .Position = 1
>>> End With
>>> End Sub
>>>
>>>
>>> Thanks
>>>
>>
>> Try this while in Excel:
>> - Open your macro for editing.
>> - Click Help
>> - In the search field, type "Pause" (without the double quotes)
>> - Follow the suggestions
>
> I've never done it in Excel, but you need a timer.
> let it run and check for a variable status every second until the
> condition is true, then execute the next part of the code.
Perhaps you might want to have a look at the "Wait" function
in Excel too - it is fully explained in the Help file.


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
How to do No hang up VBScript (nohup for VBScript) VB Script
Vista x64 1.5 min pause during boot General Discussion
Long pause on startup.. Vista General
Why does my PC pause during Boot? Vista General
PowerShell Equ of PAUSE PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46