VBA adding values to empty cells in a table

rrodwell85

New Member
Joined
Apr 18, 2016
Messages
5
I am recording player information and computing a score for each player which is being saved in a table on a worksheet named "Players". I am trying to fill in each score output into different category columns of that table. for example if Player A scored a 9 for Category 1, the score of 9 would be put into the last empty cell of the column for category 1. I have used this code which works perfectly for recording the other information regarding the players. The issue i am running into now is with the following code for inputing the scores into their categories. The code highlighted in red will input the the correct score on the appropriate line of the column for that category but will also overwrite every line above it in that column. The code in blue just creates a new line in the table and puts the score there. How can I fix this?! :confused:


Dim UnfilledCat As Long
UnfilledCat = Worksheets("Players").Cells(Rows.Count, 1).End(xlUp).Offset(1).Row
'fill in values
Worksheets("Players").Cells(UnfilledCat - 1, 17).Value = "=SUM(Category1)"
Worksheets("Players").Cells(UnfilledCat - 1, 18).Value = "=SUM(Category2)"
Worksheets("Players").Cells(UnfilledCat, 19).Value = "=SUM(Category3)"
Worksheets("Players").Cells(UnfilledCat, 20).Value = "=SUM(Category4)"


Help please! Thank you!!!!
 

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top