Yes, Format is the key, but can be weird if you want to do something too odd
https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/format-function-visual-basic-for-applications?f1url=https%3A%2F%2Fmsdn.microsoft.com%2Fquery%2Fdev11.query%3 FappId%3DDev11IDEF1%26l%3Den-US%26k%3Dk(vblr6.chm1008925)%3Bk(TargetFrameworkMoniker-Office.Version%3Dv16)%26rd%3Dtrue
Debug test output
?format(12345678901234.12,"### ### ### ### ### ##0.00")
12 345 678 901 234.10
So try something like this
MsgBox "Output: " & format(a, "### ### ### ### ### ##0.00")