I have the following macro and need to insert a command where ******* is to clear the checkboxes that are on sheet "ExpenseEnter". I don't know how to write this part of the code.
![]()
Please Login or Register to view this content.
I have the following macro and need to insert a command where ******* is to clear the checkboxes that are on sheet "ExpenseEnter". I don't know how to write this part of the code.
![]()
Please Login or Register to view this content.
Last edited by alansidman; 07-26-2016 at 08:42 PM. Reason: code tags added
Hi there,
Try inserting:
Hope this helps - please let me know how you get on.![]()
Please Login or Register to view this content.
Regards,
Greg M
Code Tags Added
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.
Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.
Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html
(Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
Alan עַם יִשְׂרָאֵל חַי
Change an Ugly Report with Power Query
Database Normalization
Complete Guide to Power Query
Man's Mind Stretched to New Dimensions Never Returns to Its Original Form
Thanks! I will make sure to do this correctly in the future.![]()
I made a macro with the code you gave me in it and tested it on the worksheet MilesEnter and it works great. When I insert the code like this though, it doesn't work.
![]()
Please Login or Register to view this content.
Hi again,
I didn't realise that more than one worksheet was involved - try using:
Hope this helps - as before, please let me know how you get on.![]()
Please Login or Register to view this content.
Regards,
Greg M
Thank you for being so patient with me. I almost sent the whole code for this, but was trying to not give more info then necessary. Now I've probably muddled things to much. Yes I am working with several worksheets. I have a main form which I'm using to automate tasks, like opening worksheets for entering etc. One macro on a button is used at the end of each month to save several worksheets as a pdf file, and then clear (reset) the worksheets used for data entry. So that I am getting everything in the right spot and not messing up what I already have working, would you be so kind as to look at the whole code and help me set this bit in where it belongs. Thank you so very much.
This is the code with no changes made:
![]()
Please Login or Register to view this content.
Hi again,
I'm a great believer in breaking code down into bite-sized pieces - it's easier to maintain and it's usually easier to understand.
See if the following version of your code does what you need:
Highlighted values can be altered to suit any future changes/requirements.![]()
Please Login or Register to view this content.
The trailing slash in the following statement isn't needed on my installation - you could experiment with omitting it:
![]()
Please Login or Register to view this content.
Hope this helps - as before, please let me know how you get on.
Regards,
Greg M
Hi again,
Instead of having three workBOOK-level Defined Names "ClearExpense", "ClearMiles" and "ClearTime", it would be better to have three workSHEET-level Defined Names (each called "tblRangeToClear") - one for each of the worksheets "ExpenseEnter", "MilesEnter" and "TimeEnter".
Once you've created these names (and deleted the original ones) you can then use the slightly neater version of the following routine instead of the one I posted previously:
![]()
Please Login or Register to view this content.
Hope this helps - as always, please keep me informed.
Regards,
Greg M
AWESOME!!! Replaced the last section as you suggested and also removed the trailing slash. Everything works beautifully!!! Thank you, thank you, thank you![]()
Hi again,
Many thanks for your feedback.
You're very welcome - glad I was able to help.
Regards,
Greg M
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks