Create Multiple Buttons All Assigned To Macro Code

  • I'd like to write a macro to create buttons with the caption "Fix" in over 300 cells. Furthermore, I would like each button, when pressed to run a macro that would copy and paste the values (paste special) of the entire row in which the button is situated as well as copy and "paste special" the values in the fixed cells $J$2, $K$2,$L$2, and $M$2. I've attached a file to clarify what I'm sure is an extremely convaluted statement of my problem. I'm not even sure where to begin. THanks!

  • Re: Macro To Create Multiple Buttons


    300 buttons is NOT a good idea, IMO. However,

  • Re: Create Multiple Buttons All Assigned To Macro Code


    Thanks - I've actually changed the buttons to checkboxes. But how can I include the part about copying and pasting special the row in which the checkbox is situated? Thanks.

  • Re: Create Multiple Buttons All Assigned To Macro Code


    Just a suggestion
    Why not have one button with the code that copies your data based on the position of the Activecell.
    Why a check box? If you need an indicator of what has been copied let the program post a check mark.
    In regard for the correct copy code.
    What Paste special features do you want, “values”?
    Where is the data to be copied to?
    Will you have multiple rows copied to a different sheet?


    [fa] * [/fa]

    [FONT="Arial Black"][COLOR="blue"][SIZE="4"]Bill[/SIZE][/COLOR][/FONT]
    Tip: To avoid chasing code always use Option Explicit.

  • Re: Create Multiple Buttons All Assigned To Macro Code


    Bill:


    I apologize for the confusion, but I did explain my problem in more detail in the original post. I'm not familiar with the activecell approach, but my idea is to make my spreadsheet as user friendly as possible. I want the user to be able to check the box and upon doing so, a macro would run to automatically copy and paste the values of the cells in the row in which the check box is situated. I need to run a macro first though to create a lot of these checkboxes (over 500). The primary purpose of the checkbox (as far as the user would be concerned) would be to represent whether a particular condominium is under contract or not. I hope this adds some clarity to my question. Thanks.

  • Re: Create Multiple Buttons All Assigned To Macro Code


    500 Checkboxes is definitely not the way to go. Too much overhead.


    Attached a sample using the sheetchange event. Select a cell in column A and if the cell is blank a check mark is placed in the cell. If there is already a check mark in the cell, the cell is cleared. The checked cells could also be colored if desired.


    The code can also be used to do the copying or reverse previous copying.


    Still don’t know where the data is to be copied?

    [FONT="Arial Black"][COLOR="blue"][SIZE="4"]Bill[/SIZE][/COLOR][/FONT]
    Tip: To avoid chasing code always use Option Explicit.