Tracking changes with selectionchange. How to define range where change occurs

  • hi everybody,


    i have a code using worksheet_selectionchange to detect if a change has been made within a defined range.


    i have a module with the following code to first define the range:



    next is the code to detect the if the change occurs with in the defined range. this code is within Sheet(1).



    when i click play by itself, define_ranges work. i tested it by adding code to select Rprecomm and the correct range of cells are selected. when i click outside Columns("B:C"), the code executes correctly, which is to exit.


    however, when i click within Columns("B:C"), it goes into debug mode and sub findcell is highlighted. also, when i go back into the excel sheet, i cannot click anything as the cell being selected is stuck at A1.


    1)is the error with the declaration of Public Rprecomm or sub findcell? i use sub findcell for my other codes and it works fine.


    2) another minor thing is that i want to execute selectionchange only after i input something, not when i click on a cell. how should i modify the code to reflect this?


    thanks for the help!

  • Re: Tracking changes with selectionchange. How to define range where change occurs


    tried debugging and pausing the code at various points. sub worksheet_selectionchange works if the code exits the sub. problems lies with Call define_ranges.


    seems like defining the range seems to be the problem. at Call define_ranges, the findcell sub is highlighted

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!