I have 2 worksheet_change events. The first works fine. The second is dependent on a spinner button which increase cell t65 by 1 but the code is not executing.
![]()
Please Login or Register to view this content.
I have 2 worksheet_change events. The first works fine. The second is dependent on a spinner button which increase cell t65 by 1 but the code is not executing.
![]()
Please Login or Register to view this content.
I'm not sure what you are trying to do but you can use only one worksheet_change event in any sheet. Secondly, you could tidy up your code quite a bit. You don't have to select a range to copy and paste it. For example:could be changed to:![]()
Please Login or Register to view this content.
and![]()
Please Login or Register to view this content.
could be changed to:![]()
Please Login or Register to view this content.
Also you only need to put this code in your macro once at the end:![]()
Please Login or Register to view this content.
I hope this helps.![]()
Please Login or Register to view this content.
Last edited by Mumps1; 12-16-2014 at 03:37 PM.
You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
Practice makes perfect. I'm very far from perfect so I'm still practising.
Nowhere in your code does the value in T65 increase by 1.
What does a "spinner button" mean to you?
Your code is extremely inefficient and there is so much of it I doubt anyone is going to rewrite it for you. Each .Select - .Copy - .Select - .Paste xlPasteValues can be simplified to this:
Furthermore. You are going to want to use Application.EnableEvents = False for what you are doing.![]()
Please Login or Register to view this content.
I used the recorder for the second part, it is copying many, many, many cells. I have a spin button (form control) separate which increases the value of T65 by 1. I wanted it to trigger the second part of the macro when cell T65 changes.
Your code is already set up to do that. For further analysis on your problem I recommend you submit a copy of you workbook with all sensitive information removed.I used the recorder for the second part, it is copying many, many, many cells. I have a spin button (form control) separate which increases the value of T65 by 1. I wanted it to trigger the second part of the macro when cell T65 changes.
When I manually change it, it works fine once and then doesn't work again, when spin button changes it, nothing happens at all. Code has been cleaned up
![]()
Please Login or Register to view this content.
Last edited by sdl2; 12-16-2014 at 08:08 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks