Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 202
Default Msg Box Yes / No Q

How could I correct the code below that a Y/N Msg Box appears if
AS1=1, if user clicks "Yes" then complete rest of code, if user
clicks "No" go to cell K10. I have a half baked attempt below


With Worksheets("Sheet A")
If .Range("AS1").Value = 1 Then
MsgBox "You have Sales that are not posted yet. If this is
correct Click ""Yes"", if not Click ""No"" and amend as necessady"

Sheets("Sheet A").Select
Range("K10").Select

Exit Sub
End If

End With
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Msg Box Yes / No Q

On Jan 15, 8:17*am, Seanie wrote:
How could I correct the code below that a Y/N Msg Box appears if
AS1=1, if user clicks "Yes" then complete rest of code, if user
clicks "No" go to cell K10. I have a half baked attempt below

* * With Worksheets("Sheet A")
* *If .Range("AS1").Value = 1 Then
* * * MsgBox "You have Sales that are not posted yet. If this is
correct Click ""Yes"", if not Click ""No"" and amend as necessady"

* * * Sheets("Sheet A").Select
* * * Range("K10").Select

* * * Exit Sub
* * End If

* * End With


Here is something like what I would do.

If .Range("AS1").Value = 1 Then
sSALES = MsgBox ("You have Sales that are not posted yet. Is this
correct?", vbYesNo + vbQuestion)
If sSALES = vbNo Then ----code
If sSALES = vbYes Then ----code
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Msg Box Yes / No Q

I think this code will do what you asked. You will need to declare a new
Long variable (named Answer) along with your other variable declarations...

With Worksheets("Sheet A")
If .Range("AS1").Value = 1 Then
Answer = MsgBox("You have Sales that are not posted yet. " & _
"If this is correct Click ""Yes"", if not " & _
"Click ""No"" and amend as necessady", vbYesNo)
If Answer = vbNo Then
.Range("K10").Select
Exit Sub
Else
'
' Code specific to a Yes answer can go here
'
End If
'
' Code placed here will run after a Yes answer too
'
End If
'
' Also, code placed here will run after a Yes answer too
'
End With

--
Rick (MVP - Excel)


"A Mad Doberman" wrote in message
...
On Jan 15, 8:17 am, Seanie wrote:
How could I correct the code below that a Y/N Msg Box appears if
AS1=1, if user clicks "Yes" then complete rest of code, if user
clicks "No" go to cell K10. I have a half baked attempt below

With Worksheets("Sheet A")
If .Range("AS1").Value = 1 Then
MsgBox "You have Sales that are not posted yet. If this is
correct Click ""Yes"", if not Click ""No"" and amend as necessady"

Sheets("Sheet A").Select
Range("K10").Select

Exit Sub
End If

End With


Here is something like what I would do.

If .Range("AS1").Value = 1 Then
sSALES = MsgBox ("You have Sales that are not posted yet. Is this
correct?", vbYesNo + vbQuestion)
If sSALES = vbNo Then ----code
If sSALES = vbYes Then ----code

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 202
Default Msg Box Yes / No Q

Thanks Guys

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Msg Box Yes / No Q

Sorry, I meant this to be a response to the OP, not to your message.

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
I think this code will do what you asked. You will need to declare a new
Long variable (named Answer) along with your other variable
declarations...

With Worksheets("Sheet A")
If .Range("AS1").Value = 1 Then
Answer = MsgBox("You have Sales that are not posted yet. " & _
"If this is correct Click ""Yes"", if not " & _
"Click ""No"" and amend as necessady", vbYesNo)
If Answer = vbNo Then
.Range("K10").Select
Exit Sub
Else
'
' Code specific to a Yes answer can go here
'
End If
'
' Code placed here will run after a Yes answer too
'
End If
'
' Also, code placed here will run after a Yes answer too
'
End With

--
Rick (MVP - Excel)


"A Mad Doberman" wrote in message
...
On Jan 15, 8:17 am, Seanie wrote:
How could I correct the code below that a Y/N Msg Box appears if
AS1=1, if user clicks "Yes" then complete rest of code, if user
clicks "No" go to cell K10. I have a half baked attempt below

With Worksheets("Sheet A")
If .Range("AS1").Value = 1 Then
MsgBox "You have Sales that are not posted yet. If this is
correct Click ""Yes"", if not Click ""No"" and amend as necessady"

Sheets("Sheet A").Select
Range("K10").Select

Exit Sub
End If

End With


Here is something like what I would do.

If .Range("AS1").Value = 1 Then
sSALES = MsgBox ("You have Sales that are not posted yet. Is this
correct?", vbYesNo + vbQuestion)
If sSALES = vbNo Then ----code
If sSALES = vbYes Then ----code




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Msg Box Yes / No Q

I think this code will do what you asked. You will need to declare a new
Long variable (named Answer) along with your other variable declarations...

With Worksheets("Sheet A")
If .Range("AS1").Value = 1 Then
Answer = MsgBox("You have Sales that are not posted yet. " & _
"If this is correct Click ""Yes"", if not " & _
"Click ""No"" and amend as necessady", vbYesNo)
If Answer = vbNo Then
.Range("K10").Select
Exit Sub
Else
'
' Code specific to a Yes answer can go here
'
End If
'
' Code placed here will run after a Yes answer too
'
End If
'
' Also, code placed here will run after a Yes answer too
'
End With

--
Rick (MVP - Excel)


"Seanie" wrote in message
...
How could I correct the code below that a Y/N Msg Box appears if
AS1=1, if user clicks "Yes" then complete rest of code, if user
clicks "No" go to cell K10. I have a half baked attempt below


With Worksheets("Sheet A")
If .Range("AS1").Value = 1 Then
MsgBox "You have Sales that are not posted yet. If this is
correct Click ""Yes"", if not Click ""No"" and amend as necessady"

Sheets("Sheet A").Select
Range("K10").Select

Exit Sub
End If

End With


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



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"