Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default UF within a loop

Excel 2002, WinXP
Up until now I have always used a UF in a structure of:
UF.Show
The UF OKClick macro calls a macro.
That macro:
Make selections
Builds an array or does something with the selection.
End macro
The UF OKClick macro unloads the UF.

Now I want to put the UF inside a loop with the following structu
Start the loop.
UF.Show (Have an OK button but no Private OKClick macro at all)
Make selections.
Build an array or do something with the selection.
Unload the UF
Exit Sub if conditions warrant
Modify the ranges and properties of the UF components (like a ListBox)
Loop

I just don't want to write all this code if my basic structure is flawed.
Is the basic structure flawed?
Will the code move on even though there is no Private OKClick macro?
Thank you for your help. Otto


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default UF within a loop

I can see already that the code will not go on to the next line after the
UF.Show line without a Private OKClick macro telling it to do so. What
should that macro say? Thanks for your help. Otto
"Otto Moehrbach" wrote in message
...
Excel 2002, WinXP
Up until now I have always used a UF in a structure of:
UF.Show
The UF OKClick macro calls a macro.
That macro:
Make selections
Builds an array or does something with the selection.
End macro
The UF OKClick macro unloads the UF.

Now I want to put the UF inside a loop with the following structu
Start the loop.
UF.Show (Have an OK button but no Private OKClick macro at all)
Make selections.
Build an array or do something with the selection.
Unload the UF
Exit Sub if conditions warrant
Modify the ranges and properties of the UF components (like a ListBox)
Loop

I just don't want to write all this code if my basic structure is flawed.
Is the basic structure flawed?
Will the code move on even though there is no Private OKClick macro?
Thank you for your help. Otto



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default UF within a loop

Otto,

You should be able to put code in the UserForm_Activate event
to run a routine while the form is showing....

Private Sub UserForm_Activate
Repaint 'optional
Call DoMyOtherStuff(Val(UserForm1.Tag))
End Sub

Regards,
Jim Cone
San Francisco, USA


"Otto Moehrbach" wrote in message
...
I can see already that the code will not go on to the next line after the
UF.Show line without a Private OKClick macro telling it to do so. What
should that macro say? Thanks for your help. Otto
"Otto Moehrbach" wrote in message
...
Excel 2002, WinXP
Up until now I have always used a UF in a structure of:
UF.Show
The UF OKClick macro calls a macro.
That macro:
Make selections
Builds an array or does something with the selection.
End macro
The UF OKClick macro unloads the UF.

Now I want to put the UF inside a loop with the following structu
Start the loop.
UF.Show (Have an OK button but no Private OKClick macro at all)
Make selections.
Build an array or do something with the selection.
Unload the UF
Exit Sub if conditions warrant
Modify the ranges and properties of the UF components (like a ListBox)
Loop

I just don't want to write all this code if my basic structure is flawed.
Is the basic structure flawed?
Will the code move on even though there is no Private OKClick macro?
Thank you for your help. Otto


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default UF within a loop

Jim
Thanks for your response. I don't think that will work in my case. The
UF has a ListBox (MultiSelect). The user selects one or more items and the
code does things with the selection(s). I think I have to revamp my
thinking some. Thanks again. Otto

"Jim Cone" wrote in message
...
Otto,

You should be able to put code in the UserForm_Activate event
to run a routine while the form is showing....

Private Sub UserForm_Activate
Repaint 'optional
Call DoMyOtherStuff(Val(UserForm1.Tag))
End Sub

Regards,
Jim Cone
San Francisco, USA


"Otto Moehrbach" wrote in message
...
I can see already that the code will not go on to the next line after the
UF.Show line without a Private OKClick macro telling it to do so. What
should that macro say? Thanks for your help. Otto
"Otto Moehrbach" wrote in message
...
Excel 2002, WinXP
Up until now I have always used a UF in a structure of:
UF.Show
The UF OKClick macro calls a macro.
That macro:
Make selections
Builds an array or does something with the selection.
End macro
The UF OKClick macro unloads the UF.

Now I want to put the UF inside a loop with the following structu
Start the loop.
UF.Show (Have an OK button but no Private OKClick macro at all)
Make selections.
Build an array or do something with the selection.
Unload the UF
Exit Sub if conditions warrant
Modify the ranges and properties of the UF components (like a
ListBox)
Loop

I just don't want to write all this code if my basic structure is
flawed.
Is the basic structure flawed?
Will the code move on even though there is no Private OKClick macro?
Thank you for your help. Otto




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find loop doesn't loop JSnow Excel Discussion (Misc queries) 2 June 24th 09 08:28 PM
How do I create a For loop within a For loop? Linking to specific cells in pivot table Excel Programming 2 January 24th 05 08:05 AM
For/Loop skipping one value in loop only Matt Jensen Excel Programming 6 January 8th 05 12:03 PM
Worksheet_Change - loop within a loop bgm Excel Programming 1 January 19th 04 01:27 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


All times are GMT +1. The time now is 11:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"