But now I am still stuck with modules. I put the IncreaseNumber function into Module1 and CommandButton1_Click() into the Sheet1 under the Excel Objects. Apparently thats wrong as I get the Object needed message.
Assuming CommandButton1 etc is on Sheet1, then it sounds like you have put everything in the right place. So...
1. What version of Excel are you using?
2. I suggest you try setting up a new file with just one sheet with...
a) Team names (say 3 of them) in column J of that sheet
b) Three command buttons with captions matching those 3 team names
c) Code as I suggested
... and see if that works (it should add 1 to the value in column K next to the correct team each time the corresponding button is clicked)
Depending on that outcome, we might be able to work out how to proceed.
Here is my sheet after the button with caption "Houston Rockets" has been clicked 7 times, "LA Lakers" button clicked once and "Utah Jazz" button clicked 13 times.
Excel Workbook |
---|
|
---|
| I | J | K | L | M |
---|
1 | | Team | W | L | |
---|
2 | | Houston Rockets | 7 | | |
---|
3 | | LA Lakers | 1 | | |
---|
4 | | Phoenix Suns | | | |
---|
5 | | Utah Jazz | 13 | | |
---|
6 | | | | | |
---|
|
---|