Quantcast
Channel: Microsoft Community - Super Fresh
Viewing all articles
Browse latest Browse all 1237235

VBA to select 1 of 2 charts.

$
0
0

I am trying to use a button to call one of 2 charts. I would like for a window to pop up & give the user the option of which chart to call.  Below is partial  code. I have used the code for other things with much success. I am trying to fill in the area after Case 1 & Case 2, with code to call the charts. Am I going about incorrectly, or is what I am attempting  even possible?

Sub Vets_Seen_Test()
Dim MyValue
     Dim i As String
    
    'MsgBox prompt:="Do you want Veterans Seen Monthly or Quarterly?", Title:="Voc. Rehab. - Career Link"
    i = MsgBox("Do you want Veterans Seen Monthly or Quarterly?", vbYesNo, "Voc. Rehab. - Career Link")
   
    If Not i = vbYes Then Exit Sub
   
    'First message shows in the body of the box, message 2 shows at the top of the box.
    Do
        MyValue = Application.InputBox("Click Ok or Cancel after your Selection!" & vbCrLf & _
                               "1 = Monthly Chart" & vbCrLf & _
                               "2 = Quarterly Chart", "Voc. Rehab - Career Link Data Entry")
        ' Sub messaage box exit.
        If MyValue = False Then
            Exit Sub
        ElseIf (MyValue = 1) Or (MyValue = 2) Then
            Exit Do
        Else
            MsgBox "You have not made a valid entry.  Please try again.", vbInformation, "Voc. Rehab. - Career Link"
        End If
    Loop    'Code to Execute When Condition = value_1
    Select Case MyValue
        Case 1

        'Code to Execute When Condition = value_2
        Case 2
  
             
         
    End Select
End Sub


Viewing all articles
Browse latest Browse all 1237235

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>