你好:
請將以下程式碼複製到 Sheet1 中
Private Sub Worksheet_Change(ByVal Target As Range)
Dim findRange As Range, rng As Range
If Target.Address(0, 0) = "C2" Then
v = "*" & Range("C2") & "*"
Set findRange = Range("D50:J61")
Set rng = findRange.Find(what:=v, LookIn:=xlFormulas, LookAt:=xlPart)
If Not rng Is Nothing Then
firstAddress = rng.Address
Do
txt = "儲存格" & rng.Address & Chr$(10) & _
"值:" & rng.Value & Chr$(10) & _
"Column:" & rng.Column & Chr$(10) & _
"Row:" & rng.Row
MsgBox txt
Set rng = findRange.FindNext(rng)
Loop While Not rng Is Nothing And rng.Address <> firstAddress
End If
End If
End Sub
以下為範例擋:
http://www.vba.com.tw/file/9604141.rar
--
天行健,君子以自強不息
地勢坤,君子以厚德載物
http://www.vba.com.tw/plog/
"alexsas" 來函:
Post by alexsas小地要寫一個vba程式,
例如:在c2 key-in文字,
在D50:J61中模糊搜尋(like),
有找到部分符合的,
在MSGBOX中秀出
該ROW的M column值
--
VBA Junior