First time posting a question – before that, I would like to say thank you to this group for their past work – I’ve found several solutions / guidance that led me to solutions over the last year.
Here the problem that has me stumped. I have a Worksheet.Change event that triggers two worksheets to be sorted via a Do until loop which works fine. I want to add code to copy a formula to a column range – basically reset those cells where I have overwritten the formula through manual input. The code works fine when it’s included in a standard module, but when the same code is included in a Worksheet.Change event, the first pass though the loop works fine (on Sheet1), but on the second pass (Sheet2) I get a Run-time error: 1004 - Select method of Range class failed on this line of code:
Range("N4", Range(endcell).Offset(0, 13)).Select
Here's the full code:
I’m mystified how this code can work fine in a normal module, and even work once in a Worksheet. Change event, but error-out on the second pass. Hopefully this is something obvious related to the differences between the two, but I’m stumped. I’ve searched on the internet, but have had no luck. The attached workbook was created to test whether there was some corruption in the original workbook causing the problem, but it behaved the same way. If you first run the macro using the button, the formula in Sheet1, A1 will be copied to the yellow highlighted cells. If you then reopen the workbook (just to reset / clear everything), then change the value in Sheet1 A29 you’ll see that the yellow highlight is completed on Sheet1 and then you will get the runtime error. . Appreciate any suggestions. Aquxiano
Bookmarks