即効テクニック |
サンプルマクロは、インプットボックスに文字列あるいはふりがなの一部を入力することで、A列を検索して、該当セルをアクティヴにします。
Sub Sample() Dim myStr As String Dim myRow As Long myStr = InputBox("検索する文字列を入力してください。", "検索") If myStr = vbNullString Then Exit Sub For myRow = 1 To Cells(Rows.Count, 1).End(xlUp).Row With Cells(myRow, 1) If (StrConv(.Characters.PhoneticCharacters _ , vbKatakana + vbNarrow) Like _ StrConv("*" & myStr & "*", vbKatakana + vbNarrow)) _ Or (.Value Like "*" & myStr & "*") Then Exit For End With Next Cells(myRow, 1).Activate End Sub