Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 10
Default Macros to Rearrange Data??

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











Attached Files
File Type: txt sample2.txt (566 Bytes, 87 views)

Last edited by taimysho0 : December 28th 12 at 09:14 PM
  #2   Report Post  
Junior Member
 
Posts: 10
Default

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











  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default 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


  #4   Report Post  
Junior Member
 
Posts: 10
Default

Quote:
Originally Posted by isabelle View Post
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:








  #5   Report Post  
Junior Member
 
Posts: 10
Default

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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rearrange Data Jcraig713 Excel Programming 5 May 30th 09 02:37 PM
Reoreder/Rearrange columns through Macros Chandrasekaran P[_2_] Excel Discussion (Misc queries) 5 May 10th 07 11:14 PM
How to rearrange data... Eric Charts and Charting in Excel 1 January 10th 07 10:31 PM
Help Rearrange Data Bob Phillips Excel Programming 0 December 28th 06 08:38 PM
Rearrange Data smithbj Excel Programming 3 July 19th 06 04:47 PM


All times are GMT +1. The time now is 12:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"