Hi!
I don't how to make some code of my macro more compact.
Here's and example of the code (it's too long to paste it all here):
![]()
Please Login or Register to view this content.
There are a lot more comboboxes like those.
Thank you!![]()
Hi!
I don't how to make some code of my macro more compact.
Here's and example of the code (it's too long to paste it all here):
![]()
Please Login or Register to view this content.
There are a lot more comboboxes like those.
Thank you!![]()
Hi there,
I haven't checked your code in detail, but it would seem that your routines are crying out for a few User-Defined Functions!
I've written a function (mdMyCalculatedValue) which I think will work in conjunction with your "ParaUnidades" routine - obviously you should change the function name to whatever is appropriate (e.g. mdMonthlySales - the first "m" is normally used to define a Module-Level function and the "d" is normally used to indicate that the function returns a Double value)
The advantage of using User-Defined functions in this way is that any future changes are confined to a single routine.
If you follow the approach used in the code shown below you should be able to produce the equivalent shortening of the other routines in your application:
![]()
Please Login or Register to view this content.
I hope you find the above helpful - please let me know how you get on.
Regards,
Greg M
That's a lot better, Greg!
Thank you very much ^^ I'll be using it in other parts of the code.
Unfortunately.... I tried to make it better and now I'm facing a problem ^^"
So I have this which is working fine:
But then I have this:![]()
Please Login or Register to view this content.
which is working fine as well BUT only because it has i = 1 :P![]()
Please Login or Register to view this content.
What I'm trying to do is:
use the same counter in "ParaUnidades" for "amntcases".
Hi again,
Try this:
![]()
Please Login or Register to view this content.
Please let me know how this works for you.
Regards,
Greg M
Greg M... YOU'RE A LIFESAVER.
Thank you very much ^^ +rep for you again.
Hi again Raquel,
You're very welcome! Many thanks for your feedback and your kind words - I'm delighted that I was able to help.
For future reference, you can make your code a LOT more user-friendly by breaking it down into bite-sized chunks as I've tried to illustrate in the following:
![]()
Please Login or Register to view this content.
I've assigned names such as "Solids", "Liquids", "Gases" etc. to the various ranges because obviously I have no idea of what sort of data your worksheets contain
Please let me know if you need help with the above or with anything else.
Best regards,
Greg M
Last edited by Greg M; 11-17-2013 at 02:10 PM. Reason: Added comment re sample names
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks