Mal has attended:
No courses
Worksheet selection change event
I created a workbook with single worksheet. I copied this sheet and did some data sorting. I created a third worksheet as a copy of the original and sorted differently. I then opened vba and went to worksheet three and clicked on view code and created a worksheet selection change event private sub. The sub used intersect methods to allow me to select several cells and then sum the highlighted cells, put in clipboard and then paste the sum. The event did not trigger. I tried selecting cells in worksheet 2 and it did not trigger. However, it did trigger when cells were selected in the original worksheet even though the private sub was in the code section for worksheet 3. Note that I did not rename worksheets. The worksheet name for sheet three was the same as the first with the (3) appended. Why is the event not triggering from the correct worksheet. Do worksheet names have to be unique?
RE: worksheet selection change event
Sorry for the previous post. I eventually found the error. In VBA, the project viewer shows Sheet3 to actually be the original worksheet. Sheet1 is the copy with the appended (3) in the name. So I just saw sheet 3 and assumed it was the one with copy (3). This was not intuitive. Only reason I can think of is the sheet ordering is named left to right by tab and my new sheets were added to the left of any existing sheets so the newest was also the first sheet from the left looking at the tabs.
RE: worksheet selection change event
Hi Mal
Thank you for using our forum
Is this something you still require assistance with?
Kind regards
Wendy Canelas
Microsoft Office Trainer