![](/img/trans.png)
[英]Excel-VBA macro to transform cell content into a comment of another cell
[英]In Excel-VBA Is it possible to move in a column (or row, or cell) based solely on the content of another cell?
我想知道是否可以不只使用空间参考(例如,“A 列”、“单元格 D3”),而是能够实现一个宏来移动,例如,在列的第四行中例如,第一个单元格包含单词“cat”。 我不知道我的问题是否清楚,以防我不只是要求进一步澄清。
到“...移动,例如,在第一个单元格包含单词“cat”的列的第四行中,您可以使用:
Rows(1).Find(What:="cat",LookAt:=xlWhole, LookIn:=xlValues).Offset(3).Select
如果第一行单元格值不是“cat”,上面的内容会抛出错误
处理这种情况:
Dim found As Range
Set found = Rows(1).Find(What:="cat",LookAt:=xlWhole, LookIn:=xlValues)
If Not found Is Nothing Then found.Offset(3).Select
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.