Find Last cell from Range VBA

2019-05-25 03:42发布

How to find location of last cell from defined Range? Cell does not have to contain any data but must be most right and most down located cell from certain Range.

Set rngOrigin = wksOrigin.Cells(IntFirstRow, IntFirstColumn).CurrentRegion

I wish to receive

Cells(i,j)

标签: vba range cell
7条回答
Root(大扎)
2楼-- · 2019-05-25 04:08

If you want the absolute last cell of a defined range, regardless of whether it has any content, here is a simple solution

Dim InputRng As Range    'define a range for the test'
Set InputRng = Range("$F$3:$F$15") 
MsgBox InputRng(1).Address & ":" & InputRng(InputRng.Cells.Count).Address    'This would output the absolute address of defined range' 

enter image description here

查看更多
登录 后发表回答