It's important to understand that Excel VBA and Google Docs (specifically Google Sheets) use different scripting languages. Therefore, you cannot directly run Excel VBA code in Google Docs.

Google provides the "Macro Converter" add on. This can help with converting some VBA macro's to Google Apps Script. However it is not a perfect process, and often requires manual adjustment of the resulting script.