Create and test a file DSN to access your teradata database. From excel, choose data-> get external data-> new database query and select the name of the DSN you just created. Follow the prompts to create and run a query. After you have that working, start recording an excel macro and repeat the process, generating the VBA code. Modify and add parameters to the code as needed.