Hey guys,
I searched the forum for a while and couldn't find anything related to this, so hopefully someone knows a simple way to accomplish what I'm trying to do. What I have going on in a little application I'm developing for a sports league is this:
1) The user selects a name from a data-validation drop down on a sheet ("Form"). The list of names resides in another sheet ("Database").
2) The user then inputs the results of the match (Wins, Losses, Points) in the sheet ("Form").
3) The user clicks a submit button to add the results to the sheet ("Database").
I can get that far just fine. Now, here's where I need some help...I want the Submit button to:
1) Find the row containing the name the user inputted in ("Database") [I think I could use the MATCH function for this, right?)
2) Add (not replace!) the inputted value for Wins into that row's appropriate Wins column
3) Add (not replace!) the inputted value for Losses into that row's appropriate Losses column
4) Add (not replace!) the inputted value for Points into that row's appropriate Points column
The main problems are in steps 2-4. How do I tell Excel where to add those values? While I know which column is Wins, Losses, Points (columns E, G, H respectively), I don't know how to tell Excel to combine the row it found using MATCH() and the columns to get an exact cell (for example H37) that it needs to update, since the 'H' comes from my own knowledge and the '37' comes from the MATCH function...
Once Excel knows the exact cell to update, I am going to use the following to add the inputted values into the cell:
Where "A1" is the location of the inputted value that I need to add to "H37".
Hopefully this was clear enough! Let me know if you have any questions!
THANKS FOR YOU HELP!!!
-Tom-
I searched the forum for a while and couldn't find anything related to this, so hopefully someone knows a simple way to accomplish what I'm trying to do. What I have going on in a little application I'm developing for a sports league is this:
1) The user selects a name from a data-validation drop down on a sheet ("Form"). The list of names resides in another sheet ("Database").
2) The user then inputs the results of the match (Wins, Losses, Points) in the sheet ("Form").
3) The user clicks a submit button to add the results to the sheet ("Database").
I can get that far just fine. Now, here's where I need some help...I want the Submit button to:
1) Find the row containing the name the user inputted in ("Database") [I think I could use the MATCH function for this, right?)
2) Add (not replace!) the inputted value for Wins into that row's appropriate Wins column
3) Add (not replace!) the inputted value for Losses into that row's appropriate Losses column
4) Add (not replace!) the inputted value for Points into that row's appropriate Points column
The main problems are in steps 2-4. How do I tell Excel where to add those values? While I know which column is Wins, Losses, Points (columns E, G, H respectively), I don't know how to tell Excel to combine the row it found using MATCH() and the columns to get an exact cell (for example H37) that it needs to update, since the 'H' comes from my own knowledge and the '37' comes from the MATCH function...
Once Excel knows the exact cell to update, I am going to use the following to add the inputted values into the cell:
Code:
Dim PointsEarned As Integer
PointsEarned = Worksheets("Form").Range("A1").value
Worksheets("Database").Range("H37").value = Worksheets("Database")Range("H37").value + PointsEarned
Hopefully this was clear enough! Let me know if you have any questions!
THANKS FOR YOU HELP!!!
-Tom-
Last edited: