|
楼主 |
发表于 2015-3-29 18:26
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Private Sub WB_MouseWheel(ByVal Button As Integer, ByVal Shift As Integer, ByVal wParam As Long, ByVal lParam As Long)
If wParam < 0 Then
Debug.Print "Wheel Moved Down"
Application.StatusBar = "Wheel Moved Down"
INow = ActiveWindow.VisibleRange.Rows(1).Row
'----------保证第一行背景颜色------
ActiveWindow.VisibleRange.Rows(1).Interior.ThemeColor = xlThemeColorAccent6
'-----------------清空之前Row的背景颜色
If ILast > 0 Then Application.ActiveSheet.Rows(ILast).Interior.Pattern = xlNone
ILast = INow '记录下上一次的Row
Else
Debug.Print "Wheel Moved Up"
Application.StatusBar = "Wheel Moved Up"
INow = ActiveWindow.VisibleRange.Rows(1).Row
'----------保证第一行背景颜色------
ActiveWindow.VisibleRange.Rows(1).Interior.ThemeColor = xlThemeColorAccent6
'-----------------清空之前Row的背景颜色
If ILast > 0 Then Application.ActiveSheet.Rows(ILast).Interior.Pattern = xlNone
ILast = INow '记录下上一次的Row
End If
End Sub
Private Sub WB_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
On Error Resume Next
Application.Caption = "X:" & X & ";" & "Y:" & Y & " " & ActiveWindow.RangeFromPoint(X, Y).Address
'ActiveWindow.RangeFromPoint(X, Y).Activate
End Sub
Private Sub WB_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
On Error Resume Next
If Button = 1 Then
Debug.Print "你按了左键"
Application.StatusBar = "你按了左键"
End If
If Button = 2 Then
Debug.Print "你按了右键"
Application.StatusBar = "你按了右键"
End If '
If Button = 4 Then
Debug.Print "你按了中键"
Application.StatusBar = "你按了中键"
End If
End Sub
|
|