neilp
Well-known Member
- Joined
- Jul 5, 2004
- Messages
- 529
- Office Version
- 365
- Platform
- Windows
Hi.
I have the following spreadsheet:
and I have the attached userform - the textboxes are in an organised manner (line1 has textbox1, line2 has textbox2 and textbox3 etc)
I need a way where by when the process button is clicked, a macro will cycle through the data focusing on the "Code" column. if it finds 1 unique code, it should paste the info from textbox1 into the "count" column of the corresponding row, if it finds 2 codes the same, it should paste textbox 2 in the first row and textbox 3 in the second row etc
the data will always be grouped by "code"
is this achievable?
thanks in advance
Neil
I have the following spreadsheet:
shelf work.xlsx | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | Collection Date | Consignment Number | Barcode Number | Code | Count | ||
2 | 2020-11-02 17:00 | ZZ3020010610021313611 | 1780565225 | 1255 | |||
3 | 2020-11-02 17:00 | ZZ3020010610021313611 | 1780565226 | 1255 | |||
4 | 2020-11-02 17:00 | ZZ3020010610021313611 | 1780565227 | 1255 | |||
5 | 2020-11-02 17:00 | ZZ3020010610021313611 | 1780565228 | 1255 | |||
6 | 2020-11-02 17:00 | ZZ3020010610021313611 | 1780565229 | 1255 | |||
7 | 2020-11-02 17:00 | ZZ3020010610021313611 | 1780565230 | 1255 | |||
8 | 2020-11-02 17:00 | ZZ3020010610021313611 | 1780565231 | 1255 | |||
9 | 2020-11-02 17:00 | ZZ3020010610021313611 | 1780565232 | 1255 | |||
10 | 2020-11-02 17:00 | ZZ3020010610021313611 | 1780565233 | 1255 | |||
11 | 2020-11-02 17:00 | ZZ3020010610021313612 | 1780565235 | 1269 | |||
12 | 2020-11-02 17:00 | ZZ3020010610021313612 | 1780565236 | 1269 | |||
13 | 2020-11-02 17:00 | ZZ3020010610021313612 | 1780565237 | 1269 | |||
14 | 2020-11-02 17:00 | ZZ3020010610021313612 | 1780565238 | 1269 | |||
15 | 2020-11-02 17:00 | ZZ3020010610021313612 | 1780565239 | 1269 | |||
16 | 2020-11-02 17:00 | ZZ3020010610021313612 | 1780565240 | 1269 | |||
17 | 2020-11-02 17:00 | ZZ3020010610021313612 | 1780565241 | 1269 | |||
18 | 2020-11-02 17:00 | ZZ3020010610021313612 | 1780565242 | 1269 | |||
19 | 2020-11-02 17:00 | ZZ3020010610021313612 | 1780565243 | 1269 | |||
20 | 2020-11-02 17:00 | ZZ3020010610021313613 | 1780565246 | 1243 | |||
21 | 2020-11-02 17:00 | ZZ3020010610021313613 | 1780565247 | 1243 | |||
22 | 2020-11-02 17:00 | ZZ3020010610021313613 | 1780565248 | 1243 | |||
23 | 2020-11-02 17:00 | ZZ3020010610021313613 | 1780565249 | 1243 | |||
24 | 2020-11-02 17:00 | ZZ3020010610021313613 | 1780565250 | 1243 | |||
25 | 2020-11-02 17:00 | ZZ3020010610021313613 | 1780565251 | 1243 | |||
26 | 2020-11-02 17:00 | ZZ3020010610021313613 | 1780565252 | 1243 | |||
27 | 2020-11-02 17:00 | ZZ3020010610021313613 | 1780565253 | 1243 | |||
28 | 2020-11-02 17:00 | ZZ3020010610021313613 | 1780565254 | 1243 | |||
29 | 2020-11-02 17:00 | ZZ3020010610021313614 | 1780565256 | 1358 | |||
30 | 2020-11-02 17:00 | ZZ3020010610021313614 | 1780565257 | 1358 | |||
31 | 2020-11-02 17:00 | ZZ3020010610021313614 | 1780565258 | 1358 | |||
32 | 2020-11-02 17:00 | ZZ3020010610021313614 | 1780565259 | 1358 | |||
33 | 2020-11-02 17:00 | ZZ3020010610021313614 | 1780565260 | 1358 | |||
34 | 2020-11-02 17:00 | ZZ3020010610021313614 | 1780565261 | 1358 | |||
35 | 2020-11-02 17:00 | ZZ3020010610021313614 | 1780565262 | 1358 | |||
36 | 2020-11-02 17:00 | ZZ3020010610021313614 | 1780565263 | 1358 | |||
37 | 2020-11-02 17:00 | ZZ3020010610021313614 | 1780565264 | 1358 | |||
38 | 2020-11-02 17:00 | ZZ3020010610021313614 | 1780565265 | 1358 | |||
39 | 2020-11-02 17:00 | ZZ3020010610021313615 | 1780565267 | 1232 | |||
40 | 2020-11-02 17:00 | ZZ3020010610021313615 | 1780565268 | 1232 | |||
41 | 2020-11-02 17:00 | ZZ3020010610021313615 | 1780565269 | 1232 | |||
42 | 2020-11-02 17:00 | ZZ3020010610021313615 | 1780565270 | 1232 | |||
43 | 2020-11-02 17:00 | ZZ3020010610021313615 | 1780565271 | 1232 | |||
44 | 2020-11-02 17:00 | ZZ3020010610021313616 | 1780565275 | 1321 | |||
45 | 2020-11-02 17:00 | ZZ3020010610021313616 | 1780565276 | 1321 | |||
46 | 2020-11-02 17:00 | ZZ3020010610021313616 | 1780565277 | 1321 | |||
47 | 2020-11-02 17:00 | ZZ3020010610021313616 | 1780565278 | 1321 | |||
48 | 2020-11-02 17:00 | ZZ3020010610021313616 | 1780565279 | 1321 | |||
49 | 2020-11-02 17:00 | ZZ3020010610021313616 | 1780565280 | 1321 | |||
50 | 2020-11-02 17:00 | ZZ3020010610021313616 | 1780565281 | 1321 | |||
51 | 2020-11-02 17:00 | ZZ3020010610021313616 | 1780565282 | 1321 | |||
52 | 2020-11-02 17:00 | ZZ3020010610021313616 | 1780565283 | 1321 | |||
53 | 2020-11-02 17:00 | ZZ3020010610021313617 | 1780565286 | 1203 | |||
54 | 2020-11-02 17:00 | ZZ3020010610021313617 | 1780565287 | 1203 | |||
55 | 2020-11-02 17:00 | ZZ3020010610021313617 | 1780565288 | 1203 | |||
56 | 2020-11-02 17:00 | ZZ3020010610021313617 | 1780565289 | 1203 | |||
57 | 2020-11-02 17:00 | ZZ3020010610021313617 | 1780565290 | 1203 | |||
58 | 2020-11-02 17:00 | ZZ3020010610021313617 | 1780565291 | 1203 | |||
59 | 2020-11-02 17:00 | ZZ3020010610021313617 | 1780565292 | 1203 | |||
60 | 2020-11-02 17:00 | ZZ3020010610021313617 | 1780565293 | 1203 | |||
61 | 2020-11-02 17:00 | ZZ3020010610021313617 | 1780565294 | 1203 | |||
62 | 2020-11-02 17:00 | ZZ3020010610021313618 | 1780565295 | 1043 | |||
63 | 2020-11-02 17:00 | ZZ3020010610021313618 | 1780565296 | 1043 | |||
64 | 2020-11-02 17:00 | ZZ3020010610021313618 | 1780565297 | 1043 | |||
65 | 2020-11-02 17:00 | ZZ3020010610021313618 | 1780565298 | 1043 | |||
66 | 2020-11-02 17:00 | ZZ3020010610021313618 | 1780565299 | 1043 | |||
67 | 2020-11-02 17:00 | ZZ3020010610021313618 | 1780565300 | 1043 | |||
68 | 2020-11-02 17:00 | ZZ3020010610021313618 | 1780565301 | 1043 | |||
69 | 2020-11-02 17:00 | ZZ3020010610021313618 | 1780565302 | 1043 | |||
70 | 2020-11-02 17:00 | ZZ3020010610021313618 | 1780565303 | 1043 | |||
data |
and I have the attached userform - the textboxes are in an organised manner (line1 has textbox1, line2 has textbox2 and textbox3 etc)
I need a way where by when the process button is clicked, a macro will cycle through the data focusing on the "Code" column. if it finds 1 unique code, it should paste the info from textbox1 into the "count" column of the corresponding row, if it finds 2 codes the same, it should paste textbox 2 in the first row and textbox 3 in the second row etc
the data will always be grouped by "code"
is this achievable?
thanks in advance
Neil