1. I think it'd help a lot if you attached a sample of the input workbook and your macro workbook
2. Your approach is not very general purpose, and I think the overall structure needs improvement
3. Guessing as to which line is causing an error (since you didn't tell)
Dim percentagecollected As Single
.....
percentagecollected = Range("H:H")
percentagecollected is Dim-ed as Single
If you want it to be a Range, then
Dim percentagecollected As Range
.....
Set percentagecollected = Range("H:H")
If you want it to be the column number, then
Dim percentagecollected As Long
.....
percentagecollected = Range("H:H").Column