Home

EXCEL VBA CODE AND LOGIC

%3CLINGO-SUB%20id%3D%22lingo-sub-748877%22%20slang%3D%22en-US%22%3EEXCEL%20VBA%20CODE%20AND%20LOGIC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-748877%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EHello%20community.%20I%20hope%20someone%20can%20help%20me%20with%20this.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20idea%20is%20to%20click%20on%20several%20buttons%20and%20excel%20registers%20which%20button%20was%20clicked%20and%20then%2C%20when%20I%20click%20on%20a%20master%20command%20button%2C%20it%20conditionally%2C%20knows%20which%20buttons%20i%20clicked%20and%20counts%20a%20number%20in%20a%20specific%20cell%20that%20is%20in%20a%20table%20that%20contains%20all%20the%20variables%20layed%20out.%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20don't%20want%20to%20use%20drop%20down%20%2C%20check%20boxes%20etc%20because%20the%20rate%20I%20want%20to%20insert%20the%20data%20is%20live%20and%20it%20should%20be%20really%20easy%20and%20intuitive%20and%20user%20friendly.%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EE.g%20I%20click%20on%20btn%201%20and%20btn2%20and%20when%20I%20click%20on%20the%20master%2C%20i%20set%20focus%20on%20the%20cell%20that%20crosses%20the%20variable%201%20and%202%20of%20the%20table%2C%20and%20counts%20a%20number%20in%20that%20place%20Is%20there%20any%20way%20to%20run%20the%20same%20command%20to%20multiple%20command%20buttons%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20tried%20to%20get%20the%20caption%20of%20the%20button%20and%20identify%20its%20number%2C%20and%20with%20the%20sum%20of%20all%20buttons%20I%20clicked%20%2C%20the%20result%20would%20be%20transformed%20in%20conditions%20that%20would%20set%20me%20to%20the%20correct%20cell%2C%20but%20I%20don't%20think%20this%20is%20the%20advisable%20approach%20Because%20I%20have%20over%20that%2070%20buttons!%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIN%20CONCLUSION%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20an%20interface%20with%20several%20buttons%20and%20i%20want%20to%20click%20on%20several%20buttons%20and%20store%20the%20info.%20When%20i%20click%20the%20%22Register%20info%22%20master%20button%20i%20want%20the%20correct%20cell%20(which%20depends%20on%20the%20several%20buttons%20i%20clicked%20before)%20to%20be%20set%20focused%20that%20allows%20me%20to%20count%201%20on%20that%20cell.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-748877%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-748908%22%20slang%3D%22en-US%22%3ERe%3A%20EXCEL%20VBA%20CODE%20AND%20LOGIC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-748908%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F374432%22%20target%3D%22_blank%22%3E%40dremanef%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EConceptually%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Ecreate%20the%20buttons%3C%2FP%3E%0A%3CP%3Ecreate%20global%20variables%2C%20one%20variable%20for%20each%20button%3C%2FP%3E%0A%3CP%3Elet%20the%20button%20code%20set%20the%20respective%20variable%20to%20a%20value%2C%20like%20%22clicked%22%3C%2FP%3E%0A%3CP%3Elet%20the%20button%20code%20for%20the%20master%20button%20check%20all%20the%20variables%20and%20then%20change%20the%20value%20of%20the%20corresponding%20cell.%20After%20that%2C%20reset%20the%20variables%20back%20to%20%22not%20clicked%22%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
dremanef
Occasional Visitor

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
Highlighted

@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"

Related Conversations
Stdev of a group of numbers continain #value!
Elbarcolutra in Excel on
0 Replies
Using Excel on a Mac from Office 365 internet version
EmilyD in Excel on
2 Replies
IF formula with variable column value to plug into equation
Lilac in Excel on
1 Replies
Calculate the points for irregular dates
chaehyun in Excel on
10 Replies
Need help with IF statements!?!
JBulmer in Excel on
3 Replies
Trying to make cells with arrows
tokkebi in Excel on
1 Replies