The workbook you attached in post #23 has the
Worksheet_SelectionChange code:
It does not contain the code that I provided, so I don't know if you want to use it or not. However, you can't/shouldn't have both the
Worksheet_SelectionChange code and the
Workbook_SheetSelectionChange code trying to operate on the same sheet as is.
Notice that A1 is empty when the worksheet is first activated. If you select a cell that's also empty, the code exits. However, if you select any cell with data, the line:
With Range(Range("A1"))
is executed. This line expects A1 to contain the address of the last selected cell but A1 is empty so the line is evaluated as:
With Range(""). Resulting in an error crash.
You may modify the code as such:
My code has the option of entire row/entire column and I don't think there would be any advantage to limit the rows to 300 and the columns to ??
Bookmarks