Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Extracting certain items from each cell


Hello,

Could someone please help with this problem:-
I have copied some columns of data from PDF and pasted into Excel whic
has dumped it all on one column.

I would usually use Text to columns for this but the data is no
logical as usual.

The columns look like this:

104B DOW REWASH 25.0 25.0
105 HOT WATER SPIN 53.8 50.0
1054 GREEN STRIP ON: OFF: 0.0 0.0
105E HOT WATER WASH(EMPICOL) 155.0 155.0
105SOAP 105 HOT WASH (SOAP) 0.0 0.0
105Z HOT WATER SPIN 0.0 0.0

Now the first bit of text is the code (104B, 105SOAP etc.)
The second bit is the description (DOW REWASH, 105 HOT WASH(SOAP
etc..)
The first number after the description is the list price and the numbe
after that is the customer price.

Can anyone think of a way I can quickly get this onto 4 columns??

Any help would be greatly appreciated.

Thanks

Joh

--
johncassel
-----------------------------------------------------------------------
johncassell's Profile: http://www.excelforum.com/member.php...fo&userid=2501
View this thread: http://www.excelforum.com/showthread.php?threadid=56103

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Extracting certain items from each cell

John,
Something like this. No to add error trapping:
Function GetParts(argDataIn As String) As Variant
Dim Temp As Variant
Dim Description As String
Dim i As Long
Dim Result(3) As Variant
Temp = Split(argDataIn, " ")
For i = 1 To UBound(Temp) - 2
Description = Description & Temp(i) & " "
Next
Description = Left(Description, Len(Description) - 1)
Result(0) = Temp(0)
Result(1) = Description
Result(2) = Temp(UBound(Temp) - 1)
Result(3) = Temp(UBound(Temp))
GetParts = Result
End Function

NickHK

"johncassell"
wrote in message
...

Hello,

Could someone please help with this problem:-
I have copied some columns of data from PDF and pasted into Excel which
has dumped it all on one column.

I would usually use Text to columns for this but the data is not
logical as usual.

The columns look like this:

104B DOW REWASH 25.0 25.0
105 HOT WATER SPIN 53.8 50.0
1054 GREEN STRIP ON: OFF: 0.0 0.0
105E HOT WATER WASH(EMPICOL) 155.0 155.0
105SOAP 105 HOT WASH (SOAP) 0.0 0.0
105Z HOT WATER SPIN 0.0 0.0

Now the first bit of text is the code (104B, 105SOAP etc.)
The second bit is the description (DOW REWASH, 105 HOT WASH(SOAP)
etc..)
The first number after the description is the list price and the number
after that is the customer price.

Can anyone think of a way I can quickly get this onto 4 columns??

Any help would be greatly appreciated.

Thanks

John


--
johncassell
------------------------------------------------------------------------
johncassell's Profile:

http://www.excelforum.com/member.php...o&userid=25016
View this thread: http://www.excelforum.com/showthread...hreadid=561036



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Extracting certain items from each cell

That should say "Need to add error trapping:"
Assumes you are using Option Base 0.

NickHK

"NickHK" wrote in message
...
John,
Something like this. No to add error trapping:
Function GetParts(argDataIn As String) As Variant
Dim Temp As Variant
Dim Description As String
Dim i As Long
Dim Result(3) As Variant
Temp = Split(argDataIn, " ")
For i = 1 To UBound(Temp) - 2
Description = Description & Temp(i) & " "
Next
Description = Left(Description, Len(Description) - 1)
Result(0) = Temp(0)
Result(1) = Description
Result(2) = Temp(UBound(Temp) - 1)
Result(3) = Temp(UBound(Temp))
GetParts = Result
End Function

NickHK

"johncassell"
wrote in message
...

Hello,

Could someone please help with this problem:-
I have copied some columns of data from PDF and pasted into Excel which
has dumped it all on one column.

I would usually use Text to columns for this but the data is not
logical as usual.

The columns look like this:

104B DOW REWASH 25.0 25.0
105 HOT WATER SPIN 53.8 50.0
1054 GREEN STRIP ON: OFF: 0.0 0.0
105E HOT WATER WASH(EMPICOL) 155.0 155.0
105SOAP 105 HOT WASH (SOAP) 0.0 0.0
105Z HOT WATER SPIN 0.0 0.0

Now the first bit of text is the code (104B, 105SOAP etc.)
The second bit is the description (DOW REWASH, 105 HOT WASH(SOAP)
etc..)
The first number after the description is the list price and the number
after that is the customer price.

Can anyone think of a way I can quickly get this onto 4 columns??

Any help would be greatly appreciated.

Thanks

John


--
johncassell
------------------------------------------------------------------------
johncassell's Profile:

http://www.excelforum.com/member.php...o&userid=25016
View this thread:

http://www.excelforum.com/showthread...hreadid=561036





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Extracting certain items from each cell

B1: =LEFT(A1,FIND(" ",A1)-1)
C1: =SUBSTITUTE(SUBSTITUTE(A1," "&E1,""),B1&" ","")
D1: =MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},SUBSTITUTE( A1,B1&"
","")&"0123456789"))+LEN(B1),
FIND(" ",A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},SUBSTITUTE(A1, B1&"
","")&"0123456789")))-
MIN(FIND({0,1,2,3,4,5,6,7,8,9},SUBSTITUTE(A1,B1&" ","")&"0123456789"))+1)
E1:=MID(A1,FIND("~",SUBSTITUTE(A1," ","~",LEN(A1)-LEN(SUBSTITUTE(A1,"
",""))))+1,255)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"johncassell"
wrote in message
...

Hello,

Could someone please help with this problem:-
I have copied some columns of data from PDF and pasted into Excel which
has dumped it all on one column.

I would usually use Text to columns for this but the data is not
logical as usual.

The columns look like this:

104B DOW REWASH 25.0 25.0
105 HOT WATER SPIN 53.8 50.0
1054 GREEN STRIP ON: OFF: 0.0 0.0
105E HOT WATER WASH(EMPICOL) 155.0 155.0
105SOAP 105 HOT WASH (SOAP) 0.0 0.0
105Z HOT WATER SPIN 0.0 0.0

Now the first bit of text is the code (104B, 105SOAP etc.)
The second bit is the description (DOW REWASH, 105 HOT WASH(SOAP)
etc..)
The first number after the description is the list price and the number
after that is the customer price.

Can anyone think of a way I can quickly get this onto 4 columns??

Any help would be greatly appreciated.

Thanks

John


--
johncassell
------------------------------------------------------------------------
johncassell's Profile:

http://www.excelforum.com/member.php...o&userid=25016
View this thread: http://www.excelforum.com/showthread...hreadid=561036



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
Extracting part of a cell Colin Hayes Excel Worksheet Functions 2 August 5th 09 12:09 PM
Extracting from a cell Walter H Excel Discussion (Misc queries) 2 January 26th 07 04:13 PM
subtracting (extracting non-duplicate items)HELP!! rtek Excel Worksheet Functions 2 May 16th 06 01:24 PM
Extracting items from Autofilter drop down Golgo 13 Excel Programming 14 August 19th 05 08:51 PM
extracting unique items turay Excel Programming 4 September 18th 04 03:37 PM


All times are GMT +1. The time now is 05:59 PM.

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"