+ Reply to Thread
Results 1 to 7 of 7

How To: When Checkbox = True, Cell X1 = Date Checkbox was checked

  1. #1
    jjward101
    Guest

    How To: When Checkbox = True, Cell X1 = Date Checkbox was checked

    Hi. I remain in awe of the willingness of people to help others in this forum... It is unlike anything I have seen before, and I am very grateful for all of you.

    Currently, the attached workbook has Userform1, with both textboxes and checkboxes. When a box is checked, a corresponding cell on another sheet is marked with the word "True", and i have conditional formatting to change the color to green. Instead of the work "True" I would like it to insert the system (short) date on the day that the box was checked, so that I can refer back to it to see when each step in the process was completed. I have tried a few different things, but cannot seem to make it work. Below is a piece of the code for the checkboxes. If anyone can help, that would be wonderful.

    Part 2.... When i go back to enter an update to a project, as opposed to editing the existing record, it creates a new line item on the 'sales' sheet. I would much prefer to be able to just update the existing record. Could anyone make a suggestion on that as well?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: How To: When Checkbox = True, Cell X1 = Date Checkbox was checked

    Please Login or Register  to view this content.

  3. #3
    jjward101
    Guest

    Re: How To: When Checkbox = True, Cell X1 = Date Checkbox was checked

    Quote Originally Posted by nigelog View Post
    Please Login or Register  to view this content.

    Thank you for your reply. I am curious, as this does not appear that it will fit with the existing code. The existing code finds the next empty row to add new records to. Will this work in that way as well?

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: How To: When Checkbox = True, Cell X1 = Date Checkbox was checked

    the attached workbook
    Where......

    As no attachment..

    Below can be simplified by Array(Fill) or Loop...But to keep it easy enough to understand...

    Part 1...Untested...
    Please Login or Register  to view this content.
    Part 2...Untested...
    Please Login or Register  to view this content.
    Last edited by sintek; 01-07-2022 at 01:09 PM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  5. #5
    jjward101
    Guest

    Re: How To: When Checkbox = True, Cell X1 = Date Checkbox was checked

    Quote Originally Posted by sintek View Post
    Where......

    As no attachment..

    Below can be simplified by Array(Fill) or Loop...But to keep it easy enough to understand...

    Part 1...Untested...
    Please Login or Register  to view this content.
    Part 2...Untested...
    Please Login or Register  to view this content.
    Thank you!!!

    The first part works flawlessly.
    The second part has an issues with this line of code
    Please Login or Register  to view this content.
    being and " invalid or unqualified reference."

    I ACTUALLY remembered to attach the file this time
    Attached Files Attached Files

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: How To: When Checkbox = True, Cell X1 = Date Checkbox was checked

    No need to quote entire posts...It just clutters the thread...
    The second part has an issues with this line of code
    That's because you changed the code
    Please Login or Register  to view this content.
    Why oh why...
    Leave it as is...Then it will work...
    Please Login or Register  to view this content.
    Or if you want to do it your way then...
    Please Login or Register  to view this content.
    Last edited by sintek; 01-08-2022 at 04:21 AM.

  7. #7
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: How To: When Checkbox = True, Cell X1 = Date Checkbox was checked

    Rainy day today, so needed to exercise grey matter.
    As I had mentioned in a previous post, with a small app keep all the code within the UserForm module.
    There are differing opinions whether to declare variables or not, if you head your module with Option Explicit followed by all your variable when you run de-bug it is amazing how many errors you can detect and eliminate.
    The one form performs all the basics of data handling (Add, Save, Update & Delete). To add a new record, first Clear the form, type in the basics (first 7 textboxes).
    To update use one or other of top two comboboxes to search for required record, second pair of comboboxes select salesman & contract manager. These are contained in two tables on the sheet 'Default' (it is bad practice to hard code variables) - no need to know anything about the code, just add or remove names from the tables.
    To make the form universal there are textboxes overlaying the comboboxes - it is what is seen in these textboxes that is saved.
    You will see an innocuous variable 'sc' that is obtained by using the upper two comboboxes for the search, using this method eliminates any requirement for search routines as there is a direct link between the 'listindex' and the table row.
    See if any of it is of use progressing your app. I am a great believer in the use and simplicity of structured tables.
    Attached Files Attached Files
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Static Date with checked checkbox
    By slmalice in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-04-2020, 04:17 PM
  2. Checkbox to date stamp cell when checked
    By jsherwood in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-22-2018, 11:43 AM
  3. [SOLVED] VBA code to uncheck checkbox 2 & 3 if checkbox 1 is checked
    By hydz1213 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-25-2013, 03:10 AM
  4. Add a date in next colomn when checkbox checked
    By dtburns in forum Excel General
    Replies: 1
    Last Post: 01-26-2011, 08:42 PM
  5. How to have Checkbox A uncheck with checked Checkbox B
    By Texas Aggie 09 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2007, 09:29 AM
  6. [SOLVED] set checkbox to enter date when checked and NOT recalculate
    By Maliniemi in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  7. [SOLVED] set checkbox to enter date when checked and NOT recalculate
    By Maliniemi in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1