Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
列Aの任意のセルに「はい」という単語が入力されたときにSheet1からSheet2に切り替えるマクロを作成しようとしています。これを機能させるのに最も近いのは、ワークシートを切り替える以下のコードです。特定のセルに「はい」と入力した場合。
Sub ifs() If Worksheets("Sheet1").Range("A1").Value = "Yes" Then Sheets("Sheet2").Select Else End If End Sub
Sub ifs() If WorkSheetFunction.CountIf(Worksheets("Sheet1").Range("A:A"),"Yes") > 0 Then Sheets("Sheet2").Select End If End Sub