文字列検索(部分一致)  次の文書

Sub 文字列検索()
Dim lngYLine As Long
Dim intXLine As Integer
Dim Obj As Object

Set Obj = Worksheets("Sheet1").Cells.Find("さくら")
If Obj Is Nothing Then
MsgBox "『さくら』はありませんでした。"
Else
lngYLine = Worksheets("Sheet1").Cells.Find("さくら").Row
intXLine = Worksheets("Sheet1").Cells.Find("さくら").Column
MsgBox "『さくら』は、" + CStr(lngYLine) + "行目の" + CStr(intXLine) + "列目にあります"
End If
End Sub

 



← 左の文字をここへ入力後 登録ボタンをクリックしてください

(サイト管理者承認後掲載されます)