View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
norhaya via OfficeKB.com norhaya via OfficeKB.com is offline
external usenet poster
 
Posts: 5
Default To join 1st line & 2nd line of text in text in Excel VBA Code

Hi

Below is the actual text file which I want to work on.

I want to join the text line situated above the text line that contain
"Category" it will become one line.

2nd, I want to join the 1 line below the text line which contain "-- Total
quantities "

--------------------------------------------------------------
Date: 05 Oct 09 7:51am
Page: 1
Item Status Report

Items selected with the control account set (All account sets ).
Sorted by item number from [ ] to [ZZZZZZZZZZZZZZZZ]

Item Number Description

47 LAMP
Category [CON] Tax status [0]
Markup factor [ 1.00 ] Last shipment [ ]
Picking sequence [ ] Stock item [Y]
Serial numbers [0] Last receipt [07 Mar 08]
Report group [ ] Unit weight [ 0.
00 ]
Avg.days between ship.[ 0 ] Average
units shipped [ 0.00 ] EA
-- Price per EA ------------- Previous price --
- Date of change -------------------------------------
Base price [ 0.00 ] [ 0.00 ]
[29/11/05]
Sale price [ 0.00 ] Sale starts [ /
/ ] ends [ / / ]
-- Type -
Percent --
Selling price based on (discount). A
[ 0.00 ]
Discount on price by (percentage). B
[ 0.00 ]
Pricing determined by (customer type ). C
[ 0.00 ]
D
[ 0.00 ]
E
[ 0.00 ]
-- Cost per EA -------------- Previous cost ---
- Date of change -------------------------------------
Standard cost [ 0.00 ] [ 0.00 ]
[29/11/05] Cost 1 [ 0.00 ]
Most recent cost [ 0.47 ] [ 0.00 ]
[07/03/08] Cost 2 [ 0.00 ]
Account set (Consumables )
Costing method (Moving average )
Total cost [ 23.50 ]
Average unit cost [ 0.47 ] EA
-- Units of measure -----------------------------------
------------------------------------------------------
Stocking unit [EA ] Pricing unit: (EA
) Costing unit: (EA )
Alternate units [ ] [ ]
[ ] [ ]
Conversion factors [ 1.0000 ] [ 1.
0000 ] [ 1.0000 ] [ 1.0000 ]
-- Total quantities ---- Qty on hand ------ Qty on P/O
------ Qty on S/O ------------------------------------
50.00 0.00
0.00 EA
-- Quantities by loc. -- Qty on hand ------ Qty on P/O
------ Qty on S/O ------------------------------------
SEL 50.00 0.00
0.00 EA
-- Reorder ----------- Minimum level -- Maximum level -
--- Reorder qty ---------- Projected sales -----------
01 Jan 09 0.00 0.00
0.00 EA 0.00 EA
------------------------------------------------------------------------------
---------------------------------------------


BSc Chem Eng Rick wrote:
Hi Norhaya

You need to give a little more info on how your sample are delimited in the
text file (i.e. are they comma delimited or tab delimited or may you have a
disk file). If you already have that info, then to join two text strings just
use the ampersand operator as follows:

Sub JoinTXT()
Dim String1 As String
Dim String2 As String
Dim String3 As String
String3 = String1 & String2
End Sub

If this helps please click "Yes"
<<<<<<<<<<

Hi

[quoted text clipped - 20 lines]

I just need the vba code to join the text. Any inputs is highly appreciated.


--
Message posted via http://www.officekb.com