LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Looping with Excel Forms

Hi All,

This might be a dumb question (and yes, there are some...) but how do I loop
through a bunch of sheets, and I have a UserForm that I need displayed for
each sheet. Here is my code:

For Each CurSheet In ThisWorkbook.Sheets
shName = Val(Right(CurSheet.Name, 3))
If shName = ThisWorkbook.Sheets("Configuration").Range("P3").V alue
And shName <= ThisWorkbook.Sheets("Configuration").Range("Q3").V alue Then
ThisWorkbook.Sheets(CurSheet.Name).Activate
frmWorkEntry.Show (0)
End If
Next CurSheet

OK, it just loops through all of the sheets and ends at the last one. I
have a 29 sheets (and it can get larger) named XXX401 through XXX430, and
the sheets are not aligned in numerical order.

I do not want to go modal, because there is information on the sheets the
users may need to complete the current sheet.

Here is the sequence of events:
1. Start Loop
2. Show user form for an item
3. Display frmWorkEntry, and let the user enter the work done for that
item.
4. Validate Work entry
5. When the 'Next' button is pressed, populate current sheet, activate next
sheet (validated to ensure that it is a correct sheet for work entry), and
loop back to step 2.
6. When there are no more work forms, quit loop.

Is there something that I am missing?

Thanks,

Jeff


 
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
Excel Macro Looping Helps Jurassien Excel Discussion (Misc queries) 9 February 10th 07 12:44 AM
Calling Forms from Forms - Exit problems Stuart[_5_] Excel Programming 3 May 25th 04 06:50 AM
Looping in Excel XP with C# -- Ranges and SpecialCells craigd Excel Programming 4 April 15th 04 03:33 AM
Excel VBA - Help looping through all but 2 workbooks waveracerr[_19_] Excel Programming 1 April 1st 04 01:50 PM
Excel VBA-Looping through Multiselection jpendegraft Excel Programming 1 February 3rd 04 02:27 PM


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

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

About Us

"It's about Microsoft Excel"