+ Reply to Thread
Results 1 to 7 of 7

Duplicating Multiple Buttons Adjusting Target Cell Automatically

  1. #1
    Registered User
    Join Date
    06-06-2014
    Posts
    16

    Duplicating Multiple Buttons Adjusting Target Cell Automatically

    Hello All,

    I tried to search the forum for my unique problem but had no luck. As you will see attached, I have a series of excel buttons I need to duplicate and have target a different set of cells. I am hoping there is a way to avoid manually doing this.

    The goal of the document is to push the button when both colours in the row and column interact (research on birds). There are two additional behaviours with an exact same set of buttons but they need to target "Body Rush" and "Food Displacement" tables underneath. I need all the buttons on one page since multiple behaviours happen simultaneously that need to be recorded.

    I have something like 100+ modules in VBA I have created, I am hoping there is an easier way to do this so I don't have to create another ~200 modules in order to get the last two behaviours setup.

    I am hoping there is either an easier button system or way to make buttons adjust somehow.

    I am not the most advanced VBA user but I appreciate any advice you can provide me or direction you can point me in. Thank you.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Duplicating Multiple Buttons Adjusting Target Cell Automatically

    How are you with VBA? Do you understand classes?
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    06-06-2014
    Posts
    16

    Re: Duplicating Multiple Buttons Adjusting Target Cell Automatically

    I can learn quickly but I'm not very familiar

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Duplicating Multiple Buttons Adjusting Target Cell Automatically

    Well, what you can do is something called event sinking. This means that you can divert the normal actions i.e. Button1_Click() to be your own.

    So you could have the event sinking, but have the code execution based on the buttons title, so you could have a button1 with sunk events, that use somthing like

    Please Login or Register  to view this content.
    private sub Scenario1() etc.

    So look at Event Sinking on google for that, its better to read than be told that.

    If i get time i'll post something.

    Essentially, you'll set all your command buttons to be the class based custom ones, then derrive the logic from there.

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Duplicating Multiple Buttons Adjusting Target Cell Automatically

    hi HDTV, welcome to ExcelForum, please check attachement, press the buttons

    I've done it only for Head Tilt. If you advise what do you need for the other two tables I would help or you can make it on your own
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-06-2014
    Posts
    16

    Re: Duplicating Multiple Buttons Adjusting Target Cell Automatically

    I forgot to say thank you! I really appreciate it!

  7. #7
    Registered User
    Join Date
    06-06-2014
    Posts
    16

    Re: Duplicating Multiple Buttons Adjusting Target Cell Automatically

    Thanks for the help! VBA is definitely a world I need to get better at!

+ 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. Automatically run macro that hides cells based on value when target cell changes
    By matdroberts in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2014, 10:44 AM
  2. [SOLVED] Adjusting Target Destination Column to Rows - Macro
    By kmrates in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-22-2013, 03:08 PM
  3. Replies: 8
    Last Post: 01-25-2013, 11:32 AM
  4. Automatically Adjusting Cell Values
    By Chloed in forum Excel General
    Replies: 2
    Last Post: 07-13-2009, 11:41 PM
  5. Replies: 4
    Last Post: 06-13-2007, 12:24 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