使用Microsoft办公自动化时,我想将图像插入电子表格中。如何确定当前用户的滚动位置?
答案 0 :(得分:0)
在Excel中,您可以使用Window对象的VisibleRange属性,即
Private Sub DirtyTest()
Dim MyW As Window, TopRow As Long, TopCol As Long
Set MyW = Windows(1) ' index 1 always refers to the window displayed
TopRow = MyW.VisibleRange.Cells.Row
TopCol = MyW.VisibleRange.Cells.Column
' any other code
End Sub
希望有所帮助
祝你好运MikeD