A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

loop code error help!!!!



 
 
Thread Tools Display Modes
  #1  
Old January 29th, 2008, 03:08 PM posted to microsoft.public.excel.misc
cesaoes
external usenet poster
 
Posts: 2
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  
Old January 29th, 2008, 03:27 PM posted to microsoft.public.excel.misc
Joel
external usenet poster
 
Posts: 2,855
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  
Old January 29th, 2008, 04:52 PM posted to microsoft.public.excel.misc
cesaoes
external usenet poster
 
Posts: 2
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?

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


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