Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 19th, 2016, 12:37 PM
Authorized User
Points: 118, Level: 2
Points: 118, Level: 2 Points: 118, Level: 2 Points: 118, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2009
Posts: 22
Thanks: 1
Thanked 0 Times in 0 Posts
Default Word text setting issue

Hi there,
Please see txt file copied at the end of this message and look for following certain elements after header info. This report when imported in Word is showing 170 pages of similar text, so I have copied just a small part of it to make my point clear. Not sure how to add a text file as attachment in this thread for now, so copying text directly here.

You will notice that for each cancelled invoice or invoice line data, there is some header data like customer name, order number, order date, customer number, salesperson and currency. This data is followed by details from that specific order.

I want to move all this header info to the detailed tabulated info for each record using macro. In other words I would like to first move headings (which are customer name, order number, order date, customer number, salesperson and currency) for each record next to Category column and their respective data in the below lines for each Line number. You will see Line number on extreme left being the first column of tabulated data.

Please advise if this could be handled using VBA. I have few years of experience using VBA in Excel but I am new to Word VBA and therefore your help would be much appreciated.

Regards,
SMI


Quote:
Customer Name: ENGRO ELENGY TERMINAL (PVT.) LIMITED. Customer Number: 2712622
Order Number: 3000001 Salesperson: No Sales Credit
Order Date: 16-NOV-15 Currency: PKR

------------------------- Cancel -------------------------
Line Item Date Quantity Unit Amount Reason By Category
------------ ----------------------- --------- ---------- ------- ------------ --------------- ------- ----------
1.1 Discharge control - Vessel - VSL - T 23-NOV-15 1 VSL 125,000. No reason provided SAEED_A ORDER
10.1 Discharge control - Vessel - VSL - T 24-NOV-15 1 VSL 189,855. No reason provided ALEXEY_ ORDER
2.1 Sampling - Vessel - VSL - Trade - OG 23-NOV-15 1 VSL 125,000. No reason provided SAEED_A ORDER
8.1 Discharge control - Vessel - VSL - T 24-NOV-15 1 VSL 1,800. No reason provided ALEXEY_ ORDER
9.1 Discharge control - Vessel - VSL - T 24-NOV-15 1 VSL 601. No reason provided ALEXEY_ ORDER
---------- -------------
Order 3000001 Totals: 5 442,256.2






Customer Name: METRON MIDDLE EAST FZE. Customer Number: 2713577
Order Number: 3000002 Salesperson: No Sales Credit
Order Date: 17-NOV-15 Currency: USD

------------------------- Cancel -------------------------
Line Item Date Quantity Unit Amount Reason By Category
------------ ----------------------- --------- ---------- ------- ------------ --------------- ------- ----------
1.1 Loading control - Vessel - MT - Trad 26-NOV-15 1000.298 MT 1,863. No reason provided MOHAMMA ORDER
---------- -------------
Order 3000002 Totals: 1,000.298 1,863.0






Customer Name: ALCOTRA S.A. GENEVA Customer Number: 2712148
Order Number: 3000004 Salesperson: No Sales Credit
Order Date: 17-NOV-15 Currency: USD

------------------------- Cancel -------------------------
Line Item Date Quantity Unit Amount Reason By Category
------------ ----------------------- --------- ---------- ------- ------------ --------------- ------- ----------
1.1 Loading control - Vessel - MT - Trad 19-NOV-15 699.986 MT 1,189. No reason provided SAEED_A ORDER
2.1 Loading control - Vessel - MT - Trad 19-NOV-15 1788.164 MT 3,352. No reason provided SAEED_A ORDER
3.1 Analysis - Package A - Ea - LS - Fie 19-NOV-15 2 Ea 700. No reason provided SAEED_A ORDER

Last edited by SMI//; October 19th, 2016 at 12:43 PM. Reason: I want to add attachment
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
ow to replace text or insert text into bookmarks in a word template aroshlakshan C# 4.0 aka C# 2010 General Discussion 0 April 28th, 2012 04:11 AM
How to insert text in to a word document from Rich Text Box aroshlakshan C# 4.0 aka C# 2010 General Discussion 0 April 28th, 2012 04:10 AM
BasePage Issue regarding Theme property setting mat41 BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 4 July 8th, 2010 03:30 AM
Script Debugger setting issue MOJ ASP.NET 1.0 and 1.1 Basics 2 January 16th, 2004 04:00 PM



All times are GMT -4. The time now is 03:39 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.