将光标移动到其他工作表中的特定单元格


0

我在“Sheet1”单元格“J2”中添加了一个值。在运行宏时,我希望光标移动到“Sheet2”列“B”,并按照“Sheet1”单元格“J2”中的每个值移动行号。请建议相同的vba代码。感谢名单

Answers:


1
Sub moveToCell()
    Dim intRow As Integer

    intRow = Sheet1.Range("J2").Value

    Sheet2.Activate
    Sheet2.Range("B" & intRow).Select
End Sub

非常多,它的作品..
avtar 2014年

这又是一个问题。如果我重命名工作表,即“Sheet1”为“Denom”,“Sheet2”为“Scroll”,则它不起作用,并且消息弹出“需要对象”。请帮助解决这个问题..
avtar 2014年

您可以在上面的代码中代替Sheet1或Sheet2,分别将它们更改为Sheets(“Denom”)和Sheets(“Scroll”)。
JNevill 2014年

在这里....比较..........
avtar 2014年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.