|
-
Jul 6th, 2012, 07:26 AM
#1
Thread Starter
Junior Member
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
-
Jul 6th, 2012, 08:00 AM
#2
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
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jul 7th, 2012, 06:06 PM
#3
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
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Jul 9th, 2012, 12:33 AM
#4
Thread Starter
Junior Member
Re: How to stop for loop until the userform complete the first task?
 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 
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
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|