Change Data Type of Table with VBA

jeffsarah721

New Member
Joined
Mar 9, 2006
Messages
8
I am trying to change the data type on an imported table from "Number" to "Text" using VBA or through a combination of SQL and VBA. The table is named EmployeesSales and the field that I want to change the data type for is called "Adi ID". I have searched all over the net and can't find any simple answers that apply directly to my situation. Can anyone help? Let me know if you need more info. Thanks!

Jeff Adams
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
you can do this with SQL like this: ALTER TABLE [TABLE_NAME] ALTER [FIELD_NAME] text;

In VBA you could just execute the sql like this: currentDB.execute "ALTER TABLE [TABLE_NAME] ALTER [FIELD_NAME] text;"

hth,
Giacomo
 
Upvote 0

Forum statistics

Threads
1,215,495
Messages
6,125,149
Members
449,208
Latest member
emmac

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