Sub FindValue()'This example Loops through Column"A", and searches for'a value selected from the input box and diplays the address with a MsgBoxDim r As RangeDim c As RangeDim s As StringDim ms As String
Set r = Range("A1", Range("A65536").End(xlUp))Let ms = "The Value was found at "Let s = InputBox("Enter Value to Find", "Hello", "Enter Number Here")For Each c In r.CellsIf c = s Then MsgBox ms & c.AddressNext c
End Sub
Tags: Excel, VBA, Find, Value, Column, loop, Range.

Nenhum comentário:
Postar um comentário