VBA Code To Import Data From SQL Server To Excel
Aug 7, 2023
Below is the VBA Code to get data from a SQL Server.
Of course you’ll have to set your connection string (I’m using the variable strDbConn on row 13) and your SQL string (row 10).
Rows 22–25 are optional, that formats the data.