Skip to content

Instantly share code, notes, and snippets.

@s-hiiragi
Created October 1, 2020 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s-hiiragi/8c4f7ebfa8ef3f80deb147b8a2e9999f to your computer and use it in GitHub Desktop.
Save s-hiiragi/8c4f7ebfa8ef3f80deb147b8a2e9999f to your computer and use it in GitHub Desktop.
指定したシートにジャンプするExcel VBAマクロ
Sub 指定したシートにジャンプ()
Dim SheetPattern As String
Dim s As Variant
SheetPattern = LCase(InputBox("シート名を入力", "指定したシートにジャンプ", ""))
If SheetPattern = "" Then
Exit Sub
End If
For Each s In ActiveWorkbook.Sheets
If LCase(s.Name) Like SheetPattern Then
s.Activate
Exit For
End If
If InStr(LCase(s.Name), SheetPattern) > 0 Then
s.Activate
Exit For
End If
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment