excel - Multiple command buttons in sequence with one another -
i new programming , want create application basketball coaches able keep stats of players using vba in excel command buttons.
instead of manually inputting stats each player in game, want able click command button players name on select player's row. click button have action on , input number.
i have 12 buttons players , 40 buttons actions (e.g. pts, reb,stl,etc.)
for example: when click player's name button, select row player's attribute in. when select action (e.g. points), add number 2 column labeled points.
i want use action buttons 12 players put number in when click player's name button. "pts" button work 12 player buttons. overall, want make stat sheet coaches command buttons instead of moving cursor , inputting information in manually.
any suggestions on how so? thank in advance.
clancy
some example code, using module-scoped variable store player being processed, might be:
option explicit private currentplayerrow long sub playera_click() currentplayerrow = 3 end sub sub playerb_click() currentplayerrow = 4 end sub sub playerc_click() currentplayerrow = 5 end sub sub action1_click() 'update column d adding 2 cell value cells(currentplayerrow, "d").value = cells(currentplayerrow, "d").value + 2 end sub sub action2_click() 'update column g adding inputted number cell value cells(currentplayerrow, "g").value = cells(currentplayerrow, "g").value + clng(inputbox("enter number:")) end sub
(not knowing basketball scoring and/or statistics, wasn't sure sort of actions wanted process.)
Comments
Post a Comment