aka_krakur
Active Member
- Joined
- Jan 31, 2006
- Messages
- 438
I have a query that brings back data that is separated by a semicolon. I then break those apart into separate columns because each data after each semicolon is it's own code and I am using these in a listbox on a userform.
Manually this is no problem; but I need to validate where these codes are coming from, so I created a query that looks them up and refreshes the list accordingly. Again, this is all manually done right now.
so, the steps I do I've started recording a macro but where I come into trouble is sometimes Column A when I convert to separate columns so I can get one long list, it varies how many columns it's expanded in to. Sometimes it could be up to Column H, sometimes it's only to Column F.
Maybe I'm going about this all wrong and there's an easier way to accomplish getting all these codes into one column so it may be used on a userform in a listbox.
Criteria that's a must.
1. I have to split them up (semicolon is the factor that helps with this)
2. I have to remove duplicates.
3. Defined Name Range will probably change every once in a while.
Here is a pasted sample of the data I am working with:
BEFORE
AFTER
Manually this is no problem; but I need to validate where these codes are coming from, so I created a query that looks them up and refreshes the list accordingly. Again, this is all manually done right now.
so, the steps I do I've started recording a macro but where I come into trouble is sometimes Column A when I convert to separate columns so I can get one long list, it varies how many columns it's expanded in to. Sometimes it could be up to Column H, sometimes it's only to Column F.
Maybe I'm going about this all wrong and there's an easier way to accomplish getting all these codes into one column so it may be used on a userform in a listbox.
Criteria that's a must.
1. I have to split them up (semicolon is the factor that helps with this)
2. I have to remove duplicates.
3. Defined Name Range will probably change every once in a while.
Here is a pasted sample of the data I am working with:
BEFORE
Book1 | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | Before | |||||
2 | REPORTED_DEV_CLARIFICATION | |||||
3 | 1049-Above; | |||||
4 | 1049-Above;1069-Shaft;1670-AboveRBP; | |||||
5 | 1049-Above;1586-Balloon; | |||||
6 | 1049-Above;1586-Balloon;1670-AboveRBP; | |||||
7 | 1049-Above;1586-Balloon;1670-AboveRBP;1586-Tip; | |||||
8 | 1049-Above;1586-Shaft;1670-AboveRBP;1670-AgainstResistance; | |||||
9 | 1049-Above;1670-AboveRBP; | |||||
10 | 1049-Above;1670-AboveRBP;1528-BalloonCatheter;1586-Balloon; | |||||
11 | 1049-Above;1670-AboveRBP;1586-Balloon; | |||||
12 | 1049-Above;1670-AboveRBP;1586-Shaft;1586-Balloon; | |||||
13 | 1049-Below; | |||||
14 | 1049-Below;1158-Dislodged; | |||||
15 | 1049-Below;1158-Partial;1670-OffLabelUse; | |||||
16 | 1049-Below;1528-GuideWire; | |||||
17 | 1049-Below;1528-GuideWire;1670-OffLabelUse; | |||||
18 | 1049-Below;1586-Balloon; | |||||
19 | 1049-Below;1586-Shaft; | |||||
20 | 1049-Below;1586-Shaft;1670-OffLabelUse; | |||||
Sheet1 |
AFTER
Book1 | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
22 | After | |||||
23 | REPORTED_DEV_CLARIFICATION | |||||
24 | 1049-Above | |||||
25 | 1049-Above | 1069-Shaft | 1670-AboveRBP | |||
26 | 1049-Above | 1586-Balloon | ||||
27 | 1049-Above | 1586-Balloon | 1670-AboveRBP | |||
28 | 1049-Above | 1586-Balloon | 1670-AboveRBP | 1586-Tip | ||
29 | 1049-Above | 1586-Shaft | 1670-AboveRBP | 1670-AgainstResistance | ||
30 | 1049-Above | 1670-AboveRBP | ||||
31 | 1049-Above | 1670-AboveRBP | 1528-BalloonCatheter | 1586-Balloon | ||
32 | 1049-Above | 1670-AboveRBP | 1586-Balloon | |||
33 | 1049-Above | 1670-AboveRBP | 1586-Shaft | 1586-Balloon | ||
34 | 1049-Below | |||||
35 | 1049-Below | 1158-Dislodged | ||||
36 | 1049-Below | 1158-Partial | 1670-OffLabelUse | |||
37 | 1049-Below | 1528-GuideWire | ||||
38 | 1049-Below | 1528-GuideWire | 1670-OffLabelUse | |||
39 | 1049-Below | 1586-Balloon | ||||
40 | 1049-Below | 1586-Shaft | ||||
41 | 1049-Below | 1586-Shaft | 1670-OffLabelUse | |||
Sheet1 |