Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default loop code error help!!!!

I have the following code,
I need it so people HAVE to answer

Dim ws As Workbook
Dim oGS As Workbook 'object Graph Sheet it was worksheet before
Set oGS = Nothing 'set to nothing in case similar code was
previously used
For Each ws In Application.Workbooks
' For Each ws In WB.Worksheets
Select Case MsgBox("Select the FedEx Worksheet" & vbLf &
"Do you want to use" & vbLf & ws.Name & "." & "?", vbYesNoCancel, "Updating
Parcel Metrics Scorecard")
'Case vbNo 'Nothing to do in this case
Case vbYes
Set oGS = ws
Exit For

End Select
'Next
If Not (MsgBox("Select Sheet", vbYesNoCancel, "Updating Parcel
Metrics Scorecard")) Then Exit For
Next



ws.Activate


what cand i do so the person using the macro is obligated to pick from the
list?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default loop code error help!!!!

Dim ws As Workbook
Dim oGS As Workbook 'object Graph Sheet it was worksheet before
Set oGS = Nothing 'set to nothing in case similar code was
previously used
Picked = False
Do while (1)
For Each ws In Application.Workbooks
' For Each ws In WB.Worksheets
Select Case MsgBox("Select the FedEx Worksheet" & vbLf &
"Do you want to use" & vbLf & ws.Name & "." & "?", vbYesNoCancel, "Updating
Parcel Metrics Scorecard")
'Case vbNo 'Nothing to do in this case
Case vbYes
Set oGS = ws
Picked = True
Exit For

End Select
'Next
If Not (MsgBox("Select Sheet", vbYesNoCancel, "Updating Parcel
Metrics Scorecard")) Then Exit For
Next
if Picked = False then
msgbox("Error: Must select at least one item, Try again")
end
loop


ws.Activate



"cesaoes" wrote:

I have the following code,
I need it so people HAVE to answer

Dim ws As Workbook
Dim oGS As Workbook 'object Graph Sheet it was worksheet before
Set oGS = Nothing 'set to nothing in case similar code was
previously used
For Each ws In Application.Workbooks
' For Each ws In WB.Worksheets
Select Case MsgBox("Select the FedEx Worksheet" & vbLf &
"Do you want to use" & vbLf & ws.Name & "." & "?", vbYesNoCancel, "Updating
Parcel Metrics Scorecard")
'Case vbNo 'Nothing to do in this case
Case vbYes
Set oGS = ws
Exit For

End Select
'Next
If Not (MsgBox("Select Sheet", vbYesNoCancel, "Updating Parcel
Metrics Scorecard")) Then Exit For
Next



ws.Activate


what cand i do so the person using the macro is obligated to pick from the
list?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default loop code error help!!!!

Thanks !!!






"Joel" wrote:

Dim ws As Workbook
Dim oGS As Workbook 'object Graph Sheet it was worksheet before
Set oGS = Nothing 'set to nothing in case similar code was
previously used
Picked = False
Do while (1)
For Each ws In Application.Workbooks
' For Each ws In WB.Worksheets
Select Case MsgBox("Select the FedEx Worksheet" & vbLf &
"Do you want to use" & vbLf & ws.Name & "." & "?", vbYesNoCancel, "Updating
Parcel Metrics Scorecard")
'Case vbNo 'Nothing to do in this case
Case vbYes
Set oGS = ws
Picked = True
Exit For

End Select
'Next
If Not (MsgBox("Select Sheet", vbYesNoCancel, "Updating Parcel
Metrics Scorecard")) Then Exit For
Next
if Picked = False then
msgbox("Error: Must select at least one item, Try again")
end
loop


ws.Activate



"cesaoes" wrote:

I have the following code,
I need it so people HAVE to answer

Dim ws As Workbook
Dim oGS As Workbook 'object Graph Sheet it was worksheet before
Set oGS = Nothing 'set to nothing in case similar code was
previously used
For Each ws In Application.Workbooks
' For Each ws In WB.Worksheets
Select Case MsgBox("Select the FedEx Worksheet" & vbLf &
"Do you want to use" & vbLf & ws.Name & "." & "?", vbYesNoCancel, "Updating
Parcel Metrics Scorecard")
'Case vbNo 'Nothing to do in this case
Case vbYes
Set oGS = ws
Exit For

End Select
'Next
If Not (MsgBox("Select Sheet", vbYesNoCancel, "Updating Parcel
Metrics Scorecard")) Then Exit For
Next



ws.Activate


what cand i do so the person using the macro is obligated to pick from the
list?

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
Edit this macro code to loop and end GarToms Excel Discussion (Misc queries) 1 January 27th 06 12:50 PM
Loop for VBA code? paulinoluciano Excel Worksheet Functions 5 December 28th 05 01:30 PM
How to Loop some code Phil Osman Excel Discussion (Misc queries) 2 August 19th 05 11:14 AM
VB for excel, how do I loop through code steve hobden via OfficeKB.com Excel Discussion (Misc queries) 2 June 9th 05 01:59 PM
VBA Newbie: Help with Do Loop code Carl Excel Discussion (Misc queries) 3 December 2nd 04 07:04 PM


All times are GMT +1. The time now is 12:12 PM.

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"