How to stop for loop until the userform complete the first task?
In my process, I Use some conditions. For every paragraphs I want to change based on the conditions. Conditions are applied using Userform in vba using (Click OK event). Here i gave the code
Code:
Dim Referencecount as integer
Dim i as integer
Dim Authorreference() as string
Selection.MoveRight unit:=wdCharacter, count:=1
For i = 1 To referencecount
Selection.MoveDown unit:=wdParagraph, count:=1, Extend:=wdExtend
Selection.Range.HighlightColorIndex = wdTurquoise
Authorreference(i) = Selection.Range.text
UserForm1.Show
Next i
Please Guide me How to stop the For loop until the userform complete the first task. Many thanks in advance:eek2:
Re: How to stop for loop until the userform complete the first task?
open it vbmodal - but will need to be closed/hidden for the code to continue.
I think it is:
Code:
UserForm1.Show vbmodal
But the f1 help on .Show should tell you
Re: How to stop for loop until the userform complete the first task?
Cross posted at
http://stackoverflow.com/questions/1...the-first-task
I am still waiting for your reply there :)
Re: How to stop for loop until the userform complete the first task?
Quote:
Originally Posted by
Deepakgopikannan
In my process, I Use some conditions. For every paragraphs I want to change based on the conditions. Conditions are applied using Userform in vba using (Click OK event). Here i gave the code
Code:
Dim Referencecount as integer
Dim i as integer
Dim Authorreference() as string
Selection.MoveRight unit:=wdCharacter, count:=1
For i = 1 To referencecount
Selection.MoveDown unit:=wdParagraph, count:=1, Extend:=wdExtend
Selection.Range.HighlightColorIndex = wdTurquoise
Authorreference(i) = Selection.Range.text
UserForm1.Show
Next i
Please Guide me
How to stop the For loop until the userform complete the first task. Many thanks in advance:eek2:
After processed the first string the userform1 had to set nothing (Set userform1 = Nothing) and have to referesh the userform1.I hope this will correct
Code:
Set userform1 = Nothing
Code:
Public Sub Refereshchkbox()
CheckBox1.Value = False
CheckBox1.Enabled = True
CheckBox2.Value = False
CheckBox2.Enabled = True
End sub