|
▼まい さん:
こんにちは
条件によって、色々な方法があると思いますが
例として2案ほど載せてみます。
Sub test1()
Dim r As Range
With Worksheets("Sheet1").Rows(3)
Set r = .Find(What:="*", After:=.Cells(1), LookIn:=xlFormulas, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, _
MatchByte:=False, SearchFormat:=False)
If Not r Is Nothing Then MsgBox r.Address(0, 0) & ":" & r.Value
End With
End Sub
Sub test2()
Dim r As Range
With Worksheets("Sheet1")
For Each r In .Range(.Range("B3"), .Cells(3, .Columns.Count))
If r.Value <> "" Then
MsgBox r.Address(0, 0) & ":" & r.Value
Exit For
End If
Next r
End With
End Sub
|
|