|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Option Explicit
- #If VBA7 Then
- Private Declare PtrSafe Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
- #Else
- Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
- #End If
- Sub test()
- Dim lx As Long, ly As Long
- Dim rn As Range
- Set rn = Range("E3")
- lx = ActiveWindow.ActivePane.PointsToScreenPixelsX(rn.Left + rn.Width / 2)
- ly = ActiveWindow.ActivePane.PointsToScreenPixelsY(rn.Top + rn.Height / 2)
- SetCursorPos lx, ly
- End Sub
复制代码 |
评分
-
2
查看全部评分
-
|