+ Reply to Thread
Results 1 to 6 of 6

Would like to use VBA/Macro to insert Active X "Check Box" into a Standard Work Checklist

  1. #1
    Registered User
    Join Date
    03-05-2014
    Location
    Eastern Shore
    MS-Off Ver
    Excel 2010
    Posts
    2

    Would like to use VBA/Macro to insert Active X "Check Box" into a Standard Work Checklist

    Hello all-

    I am new to the forum but very excited that I found you guys!! There have been several times in the past where I was in search for Excel help and most resulted in the lack there of. It looks as though there is plenty of activity on this site so I am hoping for a resoultion to my request.

    I have attached a Standard Work document that i have been working on. If you open the document, you will notice that I am using VBA to insert a "O" in the proper cell where a given task will be performed on a given day. Instead of a "O", I would like to manage the document fully electronically and was leaning towards the ActiveX Control -> Check Box. The functionality of the form must remain the way it is now....i just want to use the ActiveX Check Box so that I can open the document, check the tasks that have been completed that day, and then save the document until I reopen it the following day.

    Any help or suggestions would be appreciated.

    Thanks,

    B
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Would like to use VBA/Macro to insert Active X "Check Box" into a Standard Work Checkl

    Hello trans9_5am,

    Welcome to the Forum!

    I suspect you will have more than one sheet like "Sheet1" in the workbook. Using that many controls will increase the size of your workbook quite a bit and possibly slow it down. The controls will not retain their states once the workbook is closed.

    A better option would to use a Double Click on the cells in the columns where the O's are now. There would be no added overhead and the worksheet will retain the cell values when the workbook is closed.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Would like to use VBA/Macro to insert Active X "Check Box" into a Standard Work Checkl

    Hi,

    Are you sure you really want a macro for this? The current looping macro takes a relatively long time to process and is unnecessary given that there are perfectly good excel functions that you could use to populate F3:AJ29. Then changes would be reflected instantaneously instead of having to click a button which then takes a minute or two to process.

    Unless I've missed something I'm not sure what simply adding activex controls brings to the party unless you're going to use them for some other purpose which is not yet clear. Apart from that actually positioning the controls would require additional code to cater for the differing row heights. Not un-doable but arguably unnecessary.

    If it's just a question of marking the O in some way, i.e. akin to ticking a checkbox, then a simple sheet double click event or similar could paint the cell a different colour.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Would like to use VBA/Macro to insert Active X "Check Box" into a Standard Work Checkl

    Hello trans9_5am,

    Here is the event code that has been added to the attached workbook Double click a cell in columns "F:AJ" and "O" will be inserted if the cell is empty. If an "O" is already in the cell, it will be cleared.

    Sheet1 Double Click Event Code
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-05-2014
    Location
    Eastern Shore
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Would like to use VBA/Macro to insert Active X "Check Box" into a Standard Work Checkl

    Leith,

    I believe your solution will work for what I 'm after. This is a function that I was completely unaware of. Thank you for both a quick and intelligent response!!!

    I was wondering if along with the double click to clear the cell....could I shade the cell green? Just as a visual indicator that the task did exist, but was completed. I altered your code jus slightly to place an "X" instead of clearing the cell. It would just be a nice visual to shade the cell as well.

    This site is awesome! I will definitely recommend to anyone in the future that is looking for quick responses to Excel questions.

    Thanks again,


    B

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Would like to use VBA/Macro to insert Active X "Check Box" into a Standard Work Checkl

    Hello trans9_5am,

    Here is the updated macro to add the "X" and color and remove it.
    Please Login or Register  to view this content.

+ 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. [SOLVED] EXCEL - Match Name, Sort, Check if "Active"
    By JasonNeedsHelp in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-10-2014, 12:05 PM
  2. "Form and macro" to delete "Active" cell contents.
    By wanty in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-22-2013, 11:33 PM
  3. [SOLVED] Macro to look up and down from the active cell, copying the active "section" of the sheet
    By mikkola in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-12-2013, 07:21 PM
  4. Macro Error with code "Range("A65536").End(xlUp).EntireRow.Insert"
    By lukasj13 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-30-2010, 08:48 PM
  5. How HardDisk neme "N" or "?" (as cell value) insert into macro formula?
    By frenic in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-14-2008, 08:40 AM

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