Shortening Custom Document Property additions Context
I have blocks of if statements that check if a certain cell contains a particular string and to add to the counter of the respective custom property. Originally I was using global variables, but those are zeroed out when excel crashes. I learned of custom document properties and their non-volatility and made the switch. However, adding to the counter is a long, barely readable statement.
With global variables I had a statement like:
If cell = &quot;Heavy Duty&quot; Then numHD = numHD + 4

But now statements look like:
If cell = &quot;Heavy Duty&quot; Then ThisWorkbook.CustomDocumentProperties(&quot;numHD&quot;).Value = ThisWorkbook.CustomDocumentProperties(&quot;numHD&quot;).Value + 4

It's immensely longer and with 27 other statements doing the same thing for other strings, the code becomes taxing to read.
What I would like
Is there a way that I can shorten the custom document property edits to look more in line with what I had before with global variables? I had tried setting up a global variable as a properties type and setting to the property, then just using the variable in the actual sub:
Public numHD As Properties
Set numHD = ThisWorkbook.CustomDocumentProperties(&quot;numHD&quot;)

Sub count()
    If cell = &quot;Heavy Duty&quot; Then numHD = numHD + 4
End Sub

But Set cannot be used outside of a sub or function apparently. Any advice?
Writing to a document property is a concern in its own right, and thus deserves its own scope. Write a procedure that's responsible only for this!

Public Sub IncrementHeavyDutyCount(ByVal increment As Long)
    With ThisWorkbook.CustomDocumentProperties.Item("numHD")
        .Value = .Value + increment
    End With
End Sub


And now you can increment your counter with a simple, self-explanatory procedure call:

If cell = "Heavy Duty" Then IncrementHeavyDutyCount 4