I have this part of my code setup to respond to user input.
there are 4 periods possible but if the user has less than 4 how do i skip to the next msgbox.
MsgBox"ENTER THE PERIODS"
Do While sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.WaitForCursor 8,17
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Enter>")
Do While sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
obj.WorkSheets("sheet2").Cells(17, "C").Value = sess0.Screen.GetString(04, 39, 4) '1ST QTR
obj.WorkSheets("sheet2").Cells(29, "C").Value = sess0.Screen.GetString(09, 21, 10) '1ST QTR
Sess0.Screen.MoveTo 4,39
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Do While sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.WaitForCursor 8,17
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Enter>")
Do While sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
obj.WorkSheets("sheet2").Cells(18, "C").Value = sess0.Screen.GetString(04, 39, 4) '2ND QTR
obj.WorkSheets("sheet2").Cells(29, "D").Value = sess0.Screen.GetString(09, 21, 10) '2ND QTR
Sess0.Screen.MoveTo 4,39
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Do While sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.WaitForCursor 8,17
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Enter>")
Do While sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
obj.WorkSheets("sheet2").Cells(19, "C").Value = sess0.Screen.GetString(04, 39, 4) '3RD QTR
obj.WorkSheets("sheet2").Cells(29, "E").Value = sess0.Screen.GetString(09, 21, 10) '3RD QTR
Sess0.Screen.MoveTo 4,39
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Do While sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.WaitForCursor 8,17
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Enter>")
Do While sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
obj.WorkSheets("sheet2").Cells(20, "C").Value = sess0.Screen.GetString(04, 39, 4) '4TH QTR
obj.WorkSheets("sheet2").Cells(29, "F").Value = sess0.Screen.GetString(09, 21, 10) '4TH QTR
Sess0.Screen.MoveTo 4,39
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
'------skip to this msgbox if less than 4 periods selected above
MsgBox"(AVERAGE) ENTER THE PERIODS FOR (PAST PERIODS)"
Do While sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.WaitForCursor 8,17
there are 4 periods possible but if the user has less than 4 how do i skip to the next msgbox.
MsgBox"ENTER THE PERIODS"
Do While sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.WaitForCursor 8,17
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Enter>")
Do While sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
obj.WorkSheets("sheet2").Cells(17, "C").Value = sess0.Screen.GetString(04, 39, 4) '1ST QTR
obj.WorkSheets("sheet2").Cells(29, "C").Value = sess0.Screen.GetString(09, 21, 10) '1ST QTR
Sess0.Screen.MoveTo 4,39
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Do While sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.WaitForCursor 8,17
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Enter>")
Do While sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
obj.WorkSheets("sheet2").Cells(18, "C").Value = sess0.Screen.GetString(04, 39, 4) '2ND QTR
obj.WorkSheets("sheet2").Cells(29, "D").Value = sess0.Screen.GetString(09, 21, 10) '2ND QTR
Sess0.Screen.MoveTo 4,39
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Do While sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.WaitForCursor 8,17
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Enter>")
Do While sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
obj.WorkSheets("sheet2").Cells(19, "C").Value = sess0.Screen.GetString(04, 39, 4) '3RD QTR
obj.WorkSheets("sheet2").Cells(29, "E").Value = sess0.Screen.GetString(09, 21, 10) '3RD QTR
Sess0.Screen.MoveTo 4,39
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Do While sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.WaitForCursor 8,17
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Enter>")
Do While sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
obj.WorkSheets("sheet2").Cells(20, "C").Value = sess0.Screen.GetString(04, 39, 4) '4TH QTR
obj.WorkSheets("sheet2").Cells(29, "F").Value = sess0.Screen.GetString(09, 21, 10) '4TH QTR
Sess0.Screen.MoveTo 4,39
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
'------skip to this msgbox if less than 4 periods selected above
MsgBox"(AVERAGE) ENTER THE PERIODS FOR (PAST PERIODS)"
Do While sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.WaitForCursor 8,17