Leading spaces are trimmed in View Mode.

You can use the # icon to insert Code Formatting Tags around the selected Text.
you can also Insert the Code Formatting Tags, then Paste the code between them.

I don't do PowerPoint, but place "Option Explicit" at the very top of the code module, then Compile the code.