ribsa3
Programmer
- Jun 17, 2003
- 56
I'm trying to declare a keybinding to only work when manipulating a certain range of cells in a sheet. However, Application.OnKey seems to globally and permanently bind the key combination until the sheet is reopened.
With that, I might ask two questions:
I am monitoring a set of cells in the system subroutine Workbook_SheetChange with an If Target.Column is greater/less than a couple of values and Target.Cell is greater/less than a set of other values. This works fine, but is there a way to use an If statement to monitor changes in an entire range of cells other than:
If Selection.Column >= 2 And Selection.Column <= 6 And Selection.Row <= 105 And Selection.Row >= 10 Then
And then finally - what I am trying to accomplish is:
1: If the user selects a range of cells within the given range, write/update the range in text to Cells(2,2).
2: If the current target cell is within the defined range, pressing Shift F2 (+{F2}) executes a custom function. Being outside the range, Shift F2 should add a cell comment as per default. Here, I could optionally unbind Shift-F2 at the end of the custom function, and problem solved.
This was a bit of a rant, but I would greatly appreciate any creative suggestions
Kindly,
Bjoern Sandvik
With that, I might ask two questions:
I am monitoring a set of cells in the system subroutine Workbook_SheetChange with an If Target.Column is greater/less than a couple of values and Target.Cell is greater/less than a set of other values. This works fine, but is there a way to use an If statement to monitor changes in an entire range of cells other than:
If Selection.Column >= 2 And Selection.Column <= 6 And Selection.Row <= 105 And Selection.Row >= 10 Then
And then finally - what I am trying to accomplish is:
1: If the user selects a range of cells within the given range, write/update the range in text to Cells(2,2).
2: If the current target cell is within the defined range, pressing Shift F2 (+{F2}) executes a custom function. Being outside the range, Shift F2 should add a cell comment as per default. Here, I could optionally unbind Shift-F2 at the end of the custom function, and problem solved.
This was a bit of a rant, but I would greatly appreciate any creative suggestions
Kindly,
Bjoern Sandvik