snasui.com ยินดีต้อนรับ ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ ระบุ Version ของ Excel
Sub Searching()
Dim c As Range
Dim msg As String
msg = ""
With ActiveSheet.UsedRange
Set c = .Find(InputBox("Please enter your word that you want to find."), LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
msg = msg & c.Address & vbCrLf
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
MsgBox msg
End If
End With
End Sub