[英]Excel VBA: How to change value of cell in last used column?
I am new to VBA and am trying to locate the last used column (changes monthly) and change the second row cell in that column to "Apple." 我是VBA的新手,正在尝试查找上一次使用的列(每月更改),并将该列中的第二行单元格更改为“ Apple”。 The values in the last used column start from row 5, but I need to change row 2. Can anyone help?
最后使用的列中的值从第5行开始,但是我需要更改第2行。有人可以帮忙吗? This the code I have come up with, I understand it's flawed:
这是我想出的代码,我知道它有缺陷:
Sub NameCell()
.Cells(5, Columns.Count).End(xlToLeft).Column.Select
.FormulaR3C1 = "Apple"
End Sub
Sub NameCell()
With ActiveSheet
.Cells(2,.Cells(5, .Columns.Count).End(xlToLeft).Column).Value = "Apple"
End With
End Sub
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.