从范围VBA查找最后一个单元格 [英] Find Last cell from Range VBA

查看:243
本文介绍了从范围VBA查找最后一个单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从定义的范围中找到最后一个单元格的位置?单元格不必包含任何数据,但必须位于特定范围内最右边和最下方的单元格。

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

我希望收到

Cells(i,j)


推荐答案

也许这就是您想要的:

Dim rngLastCell As Range
Set rngLastCell = rngOrigin(rngOrigin.Count)

这篇关于从范围VBA查找最后一个单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆