Help with VBS to rename column headings and put them it a different order and save as new sheet

radams

New Member
Joined
Jun 4, 2017
Messages
2
I have an Excel 2010 database with names and addresses that need different and additional headings to be exported to MS Access 2010 (more on that later)
As the new file is updated I would also like to autofill some additional information.

I need a VBA script to open the first excel sheet with 400 +- names with this content
The list of residents looks like this


Address
City / State / Zip
First Name
Last Name
Email
Cell Phone Number

<tbody>
</tbody>
123 Apartment 3 MYTOWN, PA, 00000 Tom LSmith t.email at email (555) 555-1212

The sheet to export to Access 2010 needs to look like this and it needs to be in this exact order.
UserID
CHSetIndex
FirstName
LastName
MiddleName
Street
City
Zip
State
HomePhone
WorkPhone
LastEventLog
ExpirationDate
NeverExpiers
Active
Deleted
GotTransmitters
GotCards
GotEntryCodes
GotPhoneEntryNumbers
CustomType1
CustomType2
CustomType3
CustomType4

<tbody>
</tbody>

UserID needs to auto number (with a starting number I can put in at the beginning of the VBA script)
CHSetindex needs to be the same number IE: 3
FirstName needs to be the same as first name in the first list
Lastname needs to be the same as the last name in the first list
Middlename needs to be blank
Street needs to be the same as Address
Etc until I get to:
Lasteventlog which needs to always be a numeric value of 0
NeverExpires needs to say “TRUE” for every entry.
Active needs to say “TRUE” for every entry.
Customtype1 needs to be the email address from the first list.

I know I am asking a lot. I think I can do the rest if someone can help me get me started.

This is for a door entry system and the manufacturer has not updated their packaged software for about 5, years. And it seems they are no longer supporting this system.


If for some reason This is not posted correctly I apologize in advance
Thank you,


<tbody>
</tbody>
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
AddressCity / State / ZipFirst NameLast NameEmailCell Phone Number
123 Apartment 3MYTOWN , PA, 00000TomSmith t.email at email(555) 555-1212
The sheet to export to Access 2010 needs to look like this and it needs to be in this exact order.
UserIDCHSetIndexFirstNameLastNameMiddleNameStreetCityZipStateHomePhoneWorkPhoneLastEventLogExpirationDateNeverExpiersActiveDeletedGotTransmittersGotCardsGotEntryCodesGotPhoneEntryNumbersCustomType1CustomType2CustomType3CustomType4
66TomSmith123 Apartment 3MYTOWN 00000PA(555) 555-12120TRUETRUE t.email at email
UserID needs to auto number (with a starting number I can put in at the beginning of the VBA script)
CHSetindex needs to be the same number IE: 3
FirstName needs to be the same as first name in the first list
Lastname needs to be the same as the last name in the first list
Middlename needs to be blank
Street needs to be the same as Address
Etc until I get to:
Lasteventlog which needs to always be a numeric value of 0
NeverExpires needs to say “TRUE” for every entry.
Active needs to say “TRUE” for every entry.
Customtype1 needs to be the email address from the first list.
l
I used rows 5 and 6
in reality they would be in cells say K1 and onwards
town zip and state pulled automatically from B2
auto number is row number based

<colgroup><col><col><col><col><col><col><col><col><col><col><col span="2"><col><col><col span="6"><col><col><col span="4"></colgroup><tbody>
</tbody>
 
Upvote 0
Oldbrewer, Thank you for responding.

Was there supposed to be a VBA attached?

Thank you
 
Upvote 0

Forum statistics

Threads
1,216,746
Messages
6,132,478
Members
449,729
Latest member
davelevnt

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