+ Reply to Thread
Results 1 to 8 of 8

Repetitive tasks on forms

  1. #1
    Registered User
    Join Date
    06-25-2018
    Location
    Madrid, Spain
    MS-Off Ver
    2013
    Posts
    92

    Repetitive tasks on forms

    Howdy!

    So I have a form with quite a few entries, and it is pretty brutal to correct EVERYTHING if I have to change something and/or made a mistake. For instance, this code:

    Please Login or Register  to view this content.
    It simply makes a txtbox visible and it's combobox counter-part invisible. But doing this to every single one of the 36 entries is quite a hassle. Is there any way to make this programing easier?

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Repetitive tasks on forms

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    06-25-2018
    Location
    Madrid, Spain
    MS-Off Ver
    2013
    Posts
    92

    Re: Repetitive tasks on forms

    Thanks for that, But I guess I wasn't clear on my question.

    The issue is that I have chkNew1 to chkNew36. If I were to switch my code to yours I would need to make this change 36 times. I'm questioning if I there is a way to establish something like:

    Please Login or Register  to view this content.
    Obviously this code would not work but I guess this explain the gist of the issue. What I'm looking for is compacting all 36 checkboxes into one block of code.

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

    Re: Repetitive tasks on forms

    That will add the checkboxes but not the code required for each. Assigning a class module is probable the way to go so they all act the same.

  5. #5
    Registered User
    Join Date
    06-25-2018
    Location
    Madrid, Spain
    MS-Off Ver
    2013
    Posts
    92

    Re: Repetitive tasks on forms

    Don't really know how to use a class module, but I'll try to pull it off. I'll leave the thread open for now and comeback if (actually it should be a when...) I need some help

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

    Re: Repetitive tasks on forms

    Have a look at attached - this has a simple way of assigning a common macro to each checkbox using a simple class module with code from cytop

    Add this function to a module
    Please Login or Register  to view this content.
    And change the Class module code to
    Please Login or Register  to view this content.
    This will give you the control integer you need to pass to the macro to make items visible or not.
    If you get stuck post up what you have in a workbook
    Attached Files Attached Files
    Last edited by nigelog; 11-16-2018 at 09:08 AM.

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

    Re: Repetitive tasks on forms

    You can load the "sets of checkbox, textbox and combobox" together under the control of the class module. This would probably make like a lot easier.
    In your userform add this code along with the module code and the class module code
    Please Login or Register  to view this content.
    Edit: With the help of RoryA finished class module workbook attached
    Attached Files Attached Files
    Last edited by nigelog; 11-19-2018 at 06:45 AM.

  8. #8
    Registered User
    Join Date
    06-25-2018
    Location
    Madrid, Spain
    MS-Off Ver
    2013
    Posts
    92

    Re: Repetitive tasks on forms

    My man, this thing worked like a charm!! Thank you so much, saved me a lot of time. Rep up to you

+ 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] Repetitive Training Forms
    By Billy Spivy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-17-2018, 10:20 AM
  2. [SOLVED] Lookup tasks and sort by date and exclude completed tasks
    By AlexSchmidt in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 10-19-2017, 04:47 PM
  3. Daily Excel Reports, repetitive daily tasks
    By Lisa_NYC in forum Excel General
    Replies: 13
    Last Post: 10-15-2014, 02:46 PM
  4. Outlook Tasks - Adding tasks from a worksheet added today or after
    By dpotta in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-28-2010, 07:15 AM
  5. automating repetitive tasks
    By hoshino in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-09-2009, 01:43 AM
  6. [SOLVED] Macro -- repetitive tasks
    By OTS in forum Excel General
    Replies: 1
    Last Post: 10-07-2005, 12:05 PM
  7. [SOLVED] Using macro to run repetitive tasks
    By OTS in forum Excel General
    Replies: 1
    Last Post: 10-07-2005, 09:05 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