新規記事の投稿を行うことで、非表示にすることが可能です。
2023年01月15日
数式もしくは値が入力されている最終セルを取得する(複数行対象)
Sub Sample()
Dim myRows As Range
Dim myRng As Range
Set myRows = Rows("3:6").Cells '任意の行範囲
With myRows
Set myRng = .Find(What:="*", After:=.Cells(1), _
LookIn:=xlFormulas, Searchorder:=xlByColumns, _
SearchDirection:=xlPrevious)
End With
If myRng Is Nothing Then
MsgBox "何も入力されていません。"
Else
myRng.Select '確認用
MsgBox myRng.Address
End If
Set myRows = Nothing 'オブジェクトの解放
Set myRng = Nothing
End Sub
Dim myRows As Range
Dim myRng As Range
Set myRows = Rows("3:6").Cells '任意の行範囲
With myRows
Set myRng = .Find(What:="*", After:=.Cells(1), _
LookIn:=xlFormulas, Searchorder:=xlByColumns, _
SearchDirection:=xlPrevious)
End With
If myRng Is Nothing Then
MsgBox "何も入力されていません。"
Else
myRng.Select '確認用
MsgBox myRng.Address
End If
Set myRows = Nothing 'オブジェクトの解放
Set myRng = Nothing
End Sub