Hi,
My code works perfectly fine, but I was wondering if there was a way to make it prettier.
I like clean looking code. This code is pretty bulky
![]()
Please Login or Register to view this content.
Hi,
My code works perfectly fine, but I was wondering if there was a way to make it prettier.
I like clean looking code. This code is pretty bulky
![]()
Please Login or Register to view this content.
Last edited by Airgaf; 03-01-2011 at 07:36 PM. Reason: wrong tags
Hi there,
It's impossible for me to check the operation of the following code as I don't have access to your workbook or data. All I can say is that the code at least compiles correctly and it looks a bit neater than the original version!
Take a look at the code and see if it does what you want:
![]()
Please Login or Register to view this content.
Hope this is of some use to you - please let me know how you get on.
Regards,
Greg M
Airgaf
Please use Code Tags not Quote Tags
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
What are code tags and how do I make them?
Oh, and thank you for your help
Hi again,
in your original post you "wrapped" your code in QUOTE tags, i.e.:
Instead of using QUOTE tags (via the "Document-type" icon in the toolbar), use the one beside it (the Hash icon), and your code will look like this:Your Code Here
![]()
Please Login or Register to view this content.
By the way, did the code I proposed work correctly for you? As I mentioned, I couldn't check the operation of it myself.
Regards,
Greg M
If you bother to read the Forum Rules you would learn about Code Tags and avoid such issues. There's also a "How To" menu at the top of the Forum
Oh. My bad. I thought I was clicking the code tag this whole time. My mistake
Sorry for not replying sooner Greg, but I just finished a major presentation. Now I have time to tinker with macros. I tried your code and while it was very nice looking, I keep getting a Run-time error '9': Subscript out of range.
When I debug,
become highlighted in yellow.![]()
Please Login or Register to view this content.
Hi again,
In the code line:
![]()
Please Login or Register to view this content.
did you remember to change the value from "Sheet2" to the name of the appropriate worksheet in your workbook?The error you're seeing is consistent with not having a worksheet named "Sheet2" in your workbook.
Hope this helps - please let me know how you get on.
Regards,
Greg M
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks