Importing Excel Spreadsheets with Primary Key

skinny220

New Member
Joined
Jan 10, 2015
Messages
34
Is there a way I can run a Macro or SQL to import an excel spreadsheet and assign a primary key without using the wizard.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Sure. Set up the table ahead of time, so you have am empty table set-up just the way you like it with all the field names.
Then import the Excel sheet into that table. As long as your fields names line up and your data is in the correct format, it should work.

The Macro command for importing Excel sheets is TransferSpreadsheet.
See: https://msdn.microsoft.com/en-us/library/office/ff844793.aspx
 
Upvote 0

Forum statistics

Threads
1,221,832
Messages
6,162,255
Members
451,757
Latest member
iours

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top