0

I am trying to write a code that directs the user to a specific sheet in the workbook depending on a yes or no answer.
So basically there is information that will need to be completed and the information is specific to whether it is a YES or NO. So I want to set up a page where one of the questions is a yes/no question and depending on the answer you will be directed to a specific sheet for data input. With in that sheet there will be drop down lists specific to that sheet. Data that is based on the YES or NO question.

3
Contributors
3
Replies
10
Views
3 Years
Discussion Span
Last Post by Klahr_R
0

You can start your code any way you please
In this example I have used the Workbook_SheetChange event in the Workbook code module. This event can be triggered by changing a specific cell in a specified sheet.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim RetVal As Integer
    RetVal = MsgBox("Do You Want To View The Sheet?", vbYesNo, "Get User Response")
    If RetVal = vbYes Then Sheet2.Select
End Sub
0

A variation on my previous post if you want the "Yes" to occur in a particular cell, in this case A1

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)


    If Sh.Name = "Sheet1" _
        And Target.Address = "$A$1" _
        And UCase(Target) = "YES" Then _
        Sheet2.Select

End Sub
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.