Error with selecting range

cmeier7

Board Regular
Joined
Jul 23, 2009
Messages
64
Code:
Do
        answer2 = InputBox("Do you want to stay on the current Requirement page or go to main Roll-Up? (stay/go)")
    
        If answer2 = "stay" Then
            ActiveCell.Value = Worksheets("Sheet2").Range("A1")
            Exit Do
    
        ElseIf answer2 = "go" Then
            ActiveCell.Value = Worksheets("Sheet1").Range("A1")
            Exit Do
    
        Else
            MsgBox ("Please type either stay or go in lower case lettering.")
        End If
    Loop

Everything works. However, when I type "go," the program does not actually transfer you to Sheet (cell A1 in Sheet1 is selected, but I stay on Sheet2). Any ideas? Hope this makes some sense.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Maybe this is what you are going for:

Code:
Do
        answer2 = InputBox("Do you want to stay on the current Requirement page or go to main Roll-Up? (stay/go)")
    
        If answer2 = "stay" Then
            Worksheets("Sheet2").Activate
            Worksheets("Sheet2").Range("A1").Select
            Exit Do
    
        ElseIf answer2 = "go" Then
            Worksheets("Sheet1").Activate
            Worksheets("Sheet1").Range("A1").Select
            Exit Do
    
        Else
            MsgBox ("Please type either stay or go in lower case lettering.")
        End If
    Loop
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,871
Members
449,055
Latest member
excelhelp12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top