PDA

View Full Version : Grabbing Data..Excel VBA



lienlee
07-23-2010, 07:55 AM
Hi, Im trying to grab certain data but its not a specific one..
as you can see from the data below

IA002 has multiple ones. However I want to grab the ones that can identify each one for example: IA002x, IA002z. etc.

However, some doesnt have multiple ones and just have one.

How can I do this? usually the multiple key identifier one comes after the second \
All i need is "IA002x" or the ones that dont have multiple "IA008"

\IA002 - Product\IA002x - Product Link\
\IA002 - Product\IA002z - Customer Product Messages\
\IA002 - Product\IA002z - Customer Product Messages\
\IA002 - Product\IA002z - Forecasted Landed Cost\
\IA002 - Product\IA002_027 - Product Add - AOM\
\IA003 - Deal\IA003a - Deal - Deal System\
\IA003 - Deal\IA003b - Create Placing Deal - PSPF\
\IA003 - Deal\IA003d - Deal Calendar\
\IA008 - Store Orders - Store Operations\
\IA009 - Store Orders - Order Director\IA009a - Store Orders - Order Director\
\IA009 - Store Orders - Order Director\IA009e - Store Orders - Fixture Requisitions\
\IA010 - Store Orders - AOM\
\IA012 - Inventory - AOM\
\IA019 - PO Requirements\IA019a - PO Requirements - Manu 7.2\
\IA019 - PO Requirements\IA019b - PO Changer\
\IA021 - Purchase Orders - AOM\
\IA027 - Vendor ASN\
\IA029 - Notice To Recieve - DCCS\
\IA029 - Notice To Recieve - DCCS\IA029a - Notice to Receive - WMOS\

lienlee
07-23-2010, 06:42 PM
anyone? lol:banghead:

mbarron
07-23-2010, 08:14 PM
Please post a sample book with the raw data and the expected results.

mdmackillop
07-24-2010, 01:20 AM
I don't follow the concept of "grabbing" data. What does it mean?.
Try this meantime.
Enter this in a standard module, on the worksheet enter =MYREF(A1) or whatever.

Function MyRef(Data As Range) As String
Dim t
t = Split(Data, "\")
If UBound(t) > 2 Then
MyRef = Trim(Split(t(2), "-")(0))
Else
MyRef = Trim(Split(t(1), "-")(0))
End If
End Function