ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   loop code error help!!!! (https://www.excelbanter.com/excel-discussion-misc-queries/174807-loop-code-error-help.html)

cesaoes

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?

joel

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?


cesaoes

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?



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com