LeanneGodney
Technical User
Hi there,
I'm pulling my hair out regarding my latest problem. I am creating a spreadsheet through Access VBA that formats the spreadsheet correctly, and then places command buttons on each cell in a particular column.
The button (when clicked) needs to launch my userform, let them select something off it, and when the form closes it I want the cell UNDERNEATH the original command button to have a value placed on it.
Trouble is this:
I'm creating MULTIPLE buttons (the amount will change each time). I don't want to put different code behind each button cos there could be hundreds of them. I want ONE bit of code to run that will do teh following:
1. Identify WHICH command button was clicked so I can use the BottomRightCell property to identify where to place the resulting value.
I know the activesheet.commandbutton1.topleftcell command, but commandbutton1 changes! I'd like to use a variable here, but can't for the life of me work out how to grab the NAME of the commandbutton that the user clicks.
Can anyone please help me??
Thanks...
Leanne
I'm pulling my hair out regarding my latest problem. I am creating a spreadsheet through Access VBA that formats the spreadsheet correctly, and then places command buttons on each cell in a particular column.
The button (when clicked) needs to launch my userform, let them select something off it, and when the form closes it I want the cell UNDERNEATH the original command button to have a value placed on it.
Trouble is this:
I'm creating MULTIPLE buttons (the amount will change each time). I don't want to put different code behind each button cos there could be hundreds of them. I want ONE bit of code to run that will do teh following:
1. Identify WHICH command button was clicked so I can use the BottomRightCell property to identify where to place the resulting value.
I know the activesheet.commandbutton1.topleftcell command, but commandbutton1 changes! I'd like to use a variable here, but can't for the life of me work out how to grab the NAME of the commandbutton that the user clicks.
Can anyone please help me??
Thanks...
Leanne