ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macros to Rearrange Data?? (https://www.excelbanter.com/excel-programming/447911-macros-rearrange-data.html)

taimysho0

Macros to Rearrange Data??
 
1 Attachment(s)
Hello im new to macros and was wondering if I could get some help.

I have a file that is in txt format. When I load this file into excel, it lists all the rows of information under one column (attachment called sample.xls). I need a macros that will reorganize this column in a certain order. I have attached an example of the text file called sample2.txt (keep inm ind that this text file's order will change and is not always static, depending on the file, but it will always be in text format). Ive also included a sample of what the output should look like, but is in a .txt format but the arrangement is what im looking for with the proper value its associated with.


Thanks!!

**i also have to do some name conversions. For example if i have "Country Code" on the excel spreadsheet, i want to reorganize it in the order as the text file attached but also rename it to "Merchant_country_code" for example.

**Also, there are some rows on the excel file that are unecessary, how would i delete these rows in the macros?







***im nto sure if the excel file uploaded okay, but im pasting the data below:


XXXXXXXXXX

XXXXXXXX
XXXXXXXXXXXXXXX


Customer Service: 1-800-888-8888
Merchant Name BLAH BLAH BLAH
INC Terminal Number 1111
Merchant Terminal TID 1111111
DBA City CityVille
DBA State OO
DBA Zip 55555
DBA Phone 1800-888-8888
Daylight Savings No
SIC 1111
Industry E-Commerce
Country Code 111
Debit No
Currency Code 111
Merchant Agent 111
Language 00
Sharing Group
Agent Number 000011
Chain Number 0000011
MID 123456789011234
Store Number 12345
Merchant Location Number 12345












taimysho0

i just realized that the excel file didnt upload right the excel file lists the info below:

XXXXXXXXXX

XXXXXXXX
XXXXXXXXXXXXXXX


Customer Service: 1-800-888-8888
Merchant Name BLAH BLAH BLAH
INC Terminal Number 1111
Merchant Terminal TID 1111111
DBA City CityVille
DBA State OO
DBA Zip 55555
DBA Phone 1800-888-8888
Daylight Savings No
SIC 1111
Industry E-Commerce
Country Code 111
Debit No
Currency Code 111
Merchant Agent 111
Language 00
Sharing Group
Agent Number 000011
Chain Number 0000011
MID 123456789011234
Store Number 12345
Merchant Location Number 12345












isabelle

Macros to Rearrange Data??
 
hi taimysho0,

you forget to tell us which way you want to arrange the data, the two
joints files are identical

isabelle



taimysho0

Quote:

Originally Posted by isabelle (Post 1608307)
hi taimysho0,

you forget to tell us which way you want to arrange the data, the two
joints files are identical

isabelle

Hello isabelle,

Thanks for replying, im sorry i must have not uploaded the files correctly. In the excel file it looks like this: (only 1 column)

XXXXXXXXXX

XXXXXXXX
XXXXXXXXXXXXXXX


Customer Service: 1-800-888-8888
Merchant Name BLAH BLAH BLAH
INC Terminal Number 1111
Merchant Terminal TID 1111111
DBA City CityVille
DBA State OO
DBA Zip 55555
DBA Phone 1800-888-8888
Daylight Savings No
SIC 1111
Industry E-Commerce
Country Code 111
Debit No
Currency Code 111
Merchant Agent 111
Language 00
Sharing Group
Agent Number 000011
Chain Number 0000011
MID 123456789011234
Store Number 12345
Merchant Location Number 12345



I need a macros to run in excel to rearrange the above to look like below, however there are some extra rows in the above column that doesnt exist in the below arrangement, so if it does not have a match, it should be deleted:




bank_number:
chain_number:
bin:
category_code:
merchant_city:
merchant_country_code:
merchant_currency_code:
merchant_id:
merchant_location_number:
merchant_name:
merchant_state:
merchant_store_id:
merchant_svc_phone:
merchant_v_number:
merchant_zip_code:
usd_terminal_id:









taimysho0

i can rearrange the rows on my own, ill just need the foundation macros or the structure on how i would do this. for example


DBA Zip from 55555 (from excel spreadsheet) should ALWAYS be arranged so that its the 2nd from the last row and renamed to merchant_zip_code.


Please let me know if that makese sense. Thanks


All times are GMT +1. The time now is 10:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com