Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello:
I have the following code to add numbers to a cell when double clicking. Is it poosible to do the same thing instead of double clicking just by scrolling the scroll button on the mouse? Option Explicit Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _ Cancel As Boolean) If Target.Cells.Count 1 Then Exit Sub Cancel = True 'stop editing in cell If IsNumeric(Target.Value) Then Target.Value = Target.Value + 1 End If End Sub Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, _ Cancel As Boolean) Cancel = True 'stop pop up from showing If ActiveCell.Value <= 1 Then ActiveCell = "" Else ActiveCell.Value = ActiveCell.Value - 1 End If End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel must know what cell you want to use as the target cell. When you
simply scroll the mouse wheel, what cell do you want Excel to use? Excel doesn't know either. You can do what you want by simply selecting the cell (click on the cell) and using a Worksheet_Change event macro. HTH Otto "art" wrote in message ... Hello: I have the following code to add numbers to a cell when double clicking. Is it poosible to do the same thing instead of double clicking just by scrolling the scroll button on the mouse? Option Explicit Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _ Cancel As Boolean) If Target.Cells.Count 1 Then Exit Sub Cancel = True 'stop editing in cell If IsNumeric(Target.Value) Then Target.Value = Target.Value + 1 End If End Sub Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, _ Cancel As Boolean) Cancel = True 'stop pop up from showing If ActiveCell.Value <= 1 Then ActiveCell = "" Else ActiveCell.Value = ActiveCell.Value - 1 End If End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thats what I meant. Can you please give me the full code for that? (the
Worksheet_Change event macro). Please let me know. Thanks. "Otto Moehrbach" wrote: Excel must know what cell you want to use as the target cell. When you simply scroll the mouse wheel, what cell do you want Excel to use? Excel doesn't know either. You can do what you want by simply selecting the cell (click on the cell) and using a Worksheet_Change event macro. HTH Otto "art" wrote in message ... Hello: I have the following code to add numbers to a cell when double clicking. Is it poosible to do the same thing instead of double clicking just by scrolling the scroll button on the mouse? Option Explicit Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _ Cancel As Boolean) If Target.Cells.Count 1 Then Exit Sub Cancel = True 'stop editing in cell If IsNumeric(Target.Value) Then Target.Value = Target.Value + 1 End If End Sub Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, _ Cancel As Boolean) Cancel = True 'stop pop up from showing If ActiveCell.Value <= 1 Then ActiveCell = "" Else ActiveCell.Value = ActiveCell.Value - 1 End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cannot scroll with a Scroll Point Mouse | Excel Discussion (Misc queries) | |||
Adding a scroll bar to a cell to scroll its contents. | Excel Programming | |||
adding scroll bar to scroll on cell's content? | Charts and Charting in Excel | |||
Scroll horizontaly with mouse, create same system used to scroll . | New Users to Excel | |||
Scroll the screen view with the scroll bar | Excel Discussion (Misc queries) |