EXCEL VBA CODE AND LOGIC

Copper Contributor

Hello community. I hope someone can help me with this.

 

 

The idea is to click on several buttons and excel registers which button was clicked and then, when I click on a master command button, it conditionally, knows which buttons i clicked and counts a number in a specific cell that is in a table that contains all the variables layed out.

 

I don't want to use drop down , check boxes etc because the rate I want to insert the data is live and it should be really easy and intuitive and user friendly.

E.g I click on btn 1 and btn2 and when I click on the master, i set focus on the cell that crosses the variable 1 and 2 of the table, and counts a number in that place Is there any way to run the same command to multiple command buttons?

 

I tried to get the caption of the button and identify its number, and with the sum of all buttons I clicked , the result would be transformed in conditions that would set me to the correct cell, but I don't think this is the advisable approach Because I have over that 70 buttons!

 

IN CONCLUSION:

 

I have an interface with several buttons and i want to click on several buttons and store the info. When i click the "Register info" master button i want the correct cell (which depends on the several buttons i clicked before) to be set focused that allows me to count 1 on that cell.

 

THANK YOU VERY MUCH, 

Best Regards

André

1 Reply

@dremanef 

Conceptually:

 

create the buttons

create global variables, one variable for each button

let the button code set the respective variable to a value, like "clicked"

let the button code for the master button check all the variables and then change the value of the corresponding cell. After that, reset the variables back to "not clicked"