Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Help Excel Formatting

I have a word document that I want to convert to an excel file, that
looks like this:

Product: Apple
Price: $1.00
Amount: 2

Product: Orange
Price $2.00
Amount: 3

Product: Banana
Price: $0.50
Amount: 5

Product: Carrot
Price: $0.10
Amount: 10

I want to be able to convert it so it looks like this in excel:

Product Price Amount
Apple $1.00 2
Orange $2.00 3
Banana $0.50 5
Carrot $0.10 10


Please help! Thank you.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Help Excel Formatting

Public Sub ProcessData()
Dim i As Long
Dim iLastRow As Long

With ActiveSheet

iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 1 Step -1
If Left(.Cells(i, "A").Value, 6) = "Amount" Then
.Cells(i - 2, "C").Value = _
Trim$(Replace$(.Cells(i, "A").Value, "Amount:", ""))
.Rows(i).Delete
ElseIf Left(.Cells(i, "A").Value, 5) = "Price" Then
.Cells(i - 1, "B").Value = _
Trim$(Replace$(.Cells(i, "A").Value, "Price:", ""))
.Rows(i).Delete
ElseIf Left(.Cells(i, "A").Value, 7) = "Product" Then
.Cells(i, "A").Value = _
Trim$(Replace$(.Cells(i, "A").Value, "Product:", ""))
ElseIf .Cells(i, "A").Value = "" Then
.Rows(i).Delete
End If
Next i
.Rows(1).Insert
.Range("A1").Value = "Product"
.Range("B1").Value = "Price"
.Range("C1").Value = "Amount"

End With

End Sub

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



wrote in message
oups.com...
I have a word document that I want to convert to an excel file, that
looks like this:

Product: Apple
Price: $1.00
Amount: 2

Product: Orange
Price $2.00
Amount: 3

Product: Banana
Price: $0.50
Amount: 5

Product: Carrot
Price: $0.10
Amount: 10

I want to be able to convert it so it looks like this in excel:

Product Price Amount
Apple $1.00 2
Orange $2.00 3
Banana $0.50 5
Carrot $0.10 10


Please help! Thank you.



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
Excel formatting MK Low Excel Discussion (Misc queries) 2 April 4th 07 01:31 PM
conditional Formatting based on cell formatting Totom Excel Worksheet Functions 3 January 20th 07 02:02 PM
conditional Formatting based on cell formatting Totom Excel Worksheet Functions 0 January 15th 07 04:35 PM
expanding custom formatting without removing existing cell formatting? Keith Excel Worksheet Functions 3 December 27th 06 01:54 PM
Excel formatting SBazemore Excel Worksheet Functions 1 March 4th 05 12:37 PM


All times are GMT +1. The time now is 08:28 AM.

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

About Us

"It's about Microsoft Excel"