This is indeed the code I copied from the existing button and made some changes.
pn_decpt is declared elsewhere in the code
I have tried long, single, double, integer, variant as the object types for the Range variable and still get error 13, type mismatch. Float is not an option.