長いのでOSとExcelでわけて引越しました。加筆もしてあります。
32bitと64bitも判定します。
OSはこっち。
https://minimashia.net/vba-os-check/
Excelはこっち。
https://minimashia.net/vba-excel-check/