Timeline for Loop through different controls and enabled the state of the whole group VBA
Current License: CC BY-SA 4.0
19 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 10, 2018 at 13:39 | comment | added | TinMan | You should watch this entire series Excel VBA Introduction and read Chip Pearson - Introduction To Classes, Chip Pearson - Interfaces and Implementation, and Chip Pearson - Events And Event Procedures In VBA | |
Oct 10, 2018 at 12:32 | comment | added | QuickSilver | Thank you for all your advice and the extra info on classes much appreciated. If you have more resources about classes or links to where I can find more info to read and learn more that will be amazing. | |
Oct 10, 2018 at 0:40 | comment | added | TinMan |
I would add a Public Const DebugMode As Boolean = True to a public code module and change the UserForm_Terminate to If DebugMode = False Then ThisWorkbook.Close SaveChanges:=True . Change DebugMode = True to debug the code and DebugMode = False to put the code into production
|
|
Oct 10, 2018 at 0:33 | comment | added | TinMan | There is +1600 lines of code in the userform. Consider creating custom class to manage specific tasks. Uses MultiPage controls to group controls. Consider moving some of the tasks to their own userforms. | |
Oct 10, 2018 at 0:30 | comment | added | TinMan | Here is that example you asked for: Responding to Events of Dynamically added Controls. | |
Oct 9, 2018 at 23:41 | comment | added | QuickSilver | Overall now that you have the file any suggestion or comments on the code? Where i need more learning or improving as you are more experienced than me i value your opinion. | |
Oct 9, 2018 at 23:35 | comment | added | QuickSilver | Did some testing and still the first row becomes disabled probably there is other part of the code somewhere is making it like that. Probably i need to refactor a lot from your suggestions above and probably i'll track down where is coming from and fix it. Thank you very much for your help still got a lot to learn. | |
Oct 9, 2018 at 23:25 | comment | added | QuickSilver | Tried your suggestion and works but still need to do more testing. | |
Oct 9, 2018 at 23:10 | comment | added | TinMan |
@QuickSilver you need to use the Combobox Change Event .
|
|
Oct 9, 2018 at 22:27 | comment | added | QuickSilver | Hi you can find it on this link. All the work i did there probably can be a lot better but at the moment still a beginner in programming. drive.google.com/open?id=1Ru-EQMKAom5Idlh8xGm7DpXiLQWtxCbb | |
Oct 9, 2018 at 22:01 | vote | accept | QuickSilver | ||
Oct 9, 2018 at 21:55 | comment | added | TinMan | If you can link me the file, I'll fix it. | |
Oct 9, 2018 at 21:44 | comment | added | QuickSilver | I tried your way but even if the combobox has data in it still disables it and never set it back to true if you loop in reverse but then if you do normal loop it works. At the moment it seems your way is much cleaner than mine but it's not doing what i need it to do as there is still the issue that one of the rows will remain enabled or disabled depending how you loop top to bottom or the other way around. | |
Oct 9, 2018 at 18:06 | history | edited | TinMan | CC BY-SA 4.0 |
Fix the Enabled Control Logic
|
Oct 9, 2018 at 14:37 | comment | added | QuickSilver | I just realised from the code above and I think even mine we have same problem first row is enabled by default for my code and yours. Let’s say if all row are disable by default and enable just the first row when staff is selected you remove the -1 in the boolean and you what to loop including the first element 1? Also is there a reason you choose to do a reverse loop?? Why not a normal loop? Sorry for all the questions not in front of a computer to see how it runs. | |
Oct 9, 2018 at 12:35 | comment | added | QuickSilver | Are you able to provide with an example of how you do a class to wrap each row and respond to combobox event? Probably that is a more advanced thing you can do but at the moment I’m not at that level yet. | |
Oct 9, 2018 at 12:21 | vote | accept | QuickSilver | ||
Oct 9, 2018 at 21:44 | |||||
Oct 9, 2018 at 12:20 | comment | added | QuickSilver | You’re a genius never thought about it this way. You are right there about 13 rows of data at any given time. I can see from your code you are going in reverse from last row to 2nd and you are deducting 1. I was having an error because I couldn’t enable or disable the first or last row if it didn’t had any data in. Your code is much better than what I had I thank you for that. I guess I’m still a novice in programming 😥 | |
Oct 9, 2018 at 8:42 | history | answered | TinMan | CC BY-SA 4.0 |