Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将光标/鼠标指针设置为单元格AL2,但我的程序只能在活动工作表上进行
AL2
Dim a As Worksheet For Each Sheet In ThisWorkbook.Sheets Range("AL2").Select Next Sheet
谁能解释为什么代码不符合我的要求?
这是你正在尝试的吗?
Dim aSheet As Worksheet For Each aSheet In ThisWorkbook.Sheets aSheet.Activate Range("AL2").Select Next Sheet
话虽如此,人们应该始终避免使用.Select和.Activate
.Select
.Activate
为什么要选择一个单元格?你到底想做什么?