![]() |
If line ends in assigned value then change item in COMMENT.
I have an Excel file with text records, 1000s of lines long Trancriptions of Customer sales reps and Customers, or Distributors All data is in Collum A. Each Record has 7-10 Entries ______________________ BILLNUM : 060501 ORIG : 12345678909090 REP : 45672222222222 AREA : LK787878000000 SD : 060401 ED : 062025 COMMENT : CUSOMTER CONVERVERSATION WITH REP C:HELLO R:HELLO C:MAY I HELP YOU R:BALANCE PLEASE etc.... _____________________ BILLNUM : 050301 ORIG : 2222222222 REP : 345678909090 AREA : LK787878000000 SD : 030403 ED : 022024 COMMENT : CUSOMTER CONVERVERSATION WITH Distro C:HELLO R:HELLO C:We must have been dissconnected, sir R:Yes, thank you etc.... This example above could exist with different combinations, same order each time, fields are unique... I need a bit of VB code (MACRO) that looks at the line that begins ORIG and the line that begins with REP field and looks to see which line ends with a known value to be input reight before macro runs. Perhaps paste into any cell in a collum other than 'A' I am only searching the last 6-8 numbers that end the lines ORIG REP If ORIG ends in the last 6-8 numbers then replace "C:" as #: In the Comment Field IF REP ends in the last 6-8 numbers then replace "R:" as #: In the Comment Field in this case we look for 909090 THere could be 100's of records Between each record there are a few empty lines... this is where the MACRO would reset Here is the way I picture the output changing ______________________ BILLNUM : 060501 ORIG : 12345678909090 REP : 45672222222222 AREA : LK787878000000 SD : 060401 ED : 062025 COMMENT : CUSOMTER CONVERVERSATION WITH REP #:HELLO R:HELLO #:MAY I HELP YOU R:BALANCE PLEASE etc.... _____________________ BILLNUM : 050301 ORIG : 2222222222 REP : 345678909090 AREA : LK787878000000 SD : 030403 ED : 022024 COMMENT : CUSOMTER CONVERVERSATION WITH Distro C:HELLO #:HELLO C:We must have been dissconnected, sir #:Yes, thank you etc.... This way I always know # represents the customer when I look at the COMMENT field. I hope you can help..... -- chesspupil ------------------------------------------------------------------------ chesspupil's Profile: http://www.excelforum.com/member.php...o&userid=34645 View this thread: http://www.excelforum.com/showthread...hreadid=544130 |
All times are GMT +1. The time now is 05:29 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com