给定行中的最后一个非空单元格(列);高级语言 [英] Last not empty cell (column) in the given row; Excel VBA

查看:20
本文介绍了给定行中的最后一个非空单元格(列);高级语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Excel 表格,我需要在其中找到特定行中的最后一个非空单元格.

I have an excel sheet in which I need to find the last non empty cell in a specific row.

我该怎么做?

下面将为我选择这个,但它会选择第一个非空单元格,我需要#29行中的最后一个非空单元格.

The below will select this for me, but it will select the first not empty cell, I need the last not empty cell in the row #29.

Worksheets("DTCs").Range("A29").End(xlToRight).Select

推荐答案

我认为从另一个方向搜索可能会起作用,例如:

I think it might work just search from the other direction, so something like:

Worksheets("DTCs").Range("IV29").End(xlToLeft).Select

尽管可能需要根据 Excel 版本将 IV 更改为其他内容(这似乎在 2003 年有效).

Though maybe the IV would need to be changed to something else depending on the version of Excel (this seems to work in 2003).

这篇关于给定行中的最后一个非空单元格(列);高级语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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