user form - cycle through sheet

Status
Not open for further replies.

neilp

Well-known Member
Joined
Jul 5, 2004
Messages
529
Office Version
  1. 365
Platform
  1. Windows
Hi.

I have the following spreadsheet:
shelf work.xlsx
ABCDE
1Collection DateConsignment NumberBarcode NumberCodeCount
22020-11-02 17:00ZZ302001061002131361117805652251255
32020-11-02 17:00ZZ302001061002131361117805652261255
42020-11-02 17:00ZZ302001061002131361117805652271255
52020-11-02 17:00ZZ302001061002131361117805652281255
62020-11-02 17:00ZZ302001061002131361117805652291255
72020-11-02 17:00ZZ302001061002131361117805652301255
82020-11-02 17:00ZZ302001061002131361117805652311255
92020-11-02 17:00ZZ302001061002131361117805652321255
102020-11-02 17:00ZZ302001061002131361117805652331255
112020-11-02 17:00ZZ302001061002131361217805652351269
122020-11-02 17:00ZZ302001061002131361217805652361269
132020-11-02 17:00ZZ302001061002131361217805652371269
142020-11-02 17:00ZZ302001061002131361217805652381269
152020-11-02 17:00ZZ302001061002131361217805652391269
162020-11-02 17:00ZZ302001061002131361217805652401269
172020-11-02 17:00ZZ302001061002131361217805652411269
182020-11-02 17:00ZZ302001061002131361217805652421269
192020-11-02 17:00ZZ302001061002131361217805652431269
202020-11-02 17:00ZZ302001061002131361317805652461243
212020-11-02 17:00ZZ302001061002131361317805652471243
222020-11-02 17:00ZZ302001061002131361317805652481243
232020-11-02 17:00ZZ302001061002131361317805652491243
242020-11-02 17:00ZZ302001061002131361317805652501243
252020-11-02 17:00ZZ302001061002131361317805652511243
262020-11-02 17:00ZZ302001061002131361317805652521243
272020-11-02 17:00ZZ302001061002131361317805652531243
282020-11-02 17:00ZZ302001061002131361317805652541243
292020-11-02 17:00ZZ302001061002131361417805652561358
302020-11-02 17:00ZZ302001061002131361417805652571358
312020-11-02 17:00ZZ302001061002131361417805652581358
322020-11-02 17:00ZZ302001061002131361417805652591358
332020-11-02 17:00ZZ302001061002131361417805652601358
342020-11-02 17:00ZZ302001061002131361417805652611358
352020-11-02 17:00ZZ302001061002131361417805652621358
362020-11-02 17:00ZZ302001061002131361417805652631358
372020-11-02 17:00ZZ302001061002131361417805652641358
382020-11-02 17:00ZZ302001061002131361417805652651358
392020-11-02 17:00ZZ302001061002131361517805652671232
402020-11-02 17:00ZZ302001061002131361517805652681232
412020-11-02 17:00ZZ302001061002131361517805652691232
422020-11-02 17:00ZZ302001061002131361517805652701232
432020-11-02 17:00ZZ302001061002131361517805652711232
442020-11-02 17:00ZZ302001061002131361617805652751321
452020-11-02 17:00ZZ302001061002131361617805652761321
462020-11-02 17:00ZZ302001061002131361617805652771321
472020-11-02 17:00ZZ302001061002131361617805652781321
482020-11-02 17:00ZZ302001061002131361617805652791321
492020-11-02 17:00ZZ302001061002131361617805652801321
502020-11-02 17:00ZZ302001061002131361617805652811321
512020-11-02 17:00ZZ302001061002131361617805652821321
522020-11-02 17:00ZZ302001061002131361617805652831321
532020-11-02 17:00ZZ302001061002131361717805652861203
542020-11-02 17:00ZZ302001061002131361717805652871203
552020-11-02 17:00ZZ302001061002131361717805652881203
562020-11-02 17:00ZZ302001061002131361717805652891203
572020-11-02 17:00ZZ302001061002131361717805652901203
582020-11-02 17:00ZZ302001061002131361717805652911203
592020-11-02 17:00ZZ302001061002131361717805652921203
602020-11-02 17:00ZZ302001061002131361717805652931203
612020-11-02 17:00ZZ302001061002131361717805652941203
622020-11-02 17:00ZZ302001061002131361817805652951043
632020-11-02 17:00ZZ302001061002131361817805652961043
642020-11-02 17:00ZZ302001061002131361817805652971043
652020-11-02 17:00ZZ302001061002131361817805652981043
662020-11-02 17:00ZZ302001061002131361817805652991043
672020-11-02 17:00ZZ302001061002131361817805653001043
682020-11-02 17:00ZZ302001061002131361817805653011043
692020-11-02 17:00ZZ302001061002131361817805653021043
702020-11-02 17:00ZZ302001061002131361817805653031043
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
 

Attachments

  • Capture.JPG
    Capture.JPG
    64.7 KB · Views: 3

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
please provide sample textbox data and amended results sheet
thank you
 
Upvote 0
Hi Yongle

I have amended the spreadsheet slightly to make it a touch more understandable, and also included expected results from the attached updated userform

Copy of shelf work.xls
ABCDE
1Collection DateConsignment NumberBarcode NumberCodeCount
22020-11-02 17:00ZZ3020010610021313613178056524612433
32020-11-02 17:00ZZ3020010610021313613178056524712432
42020-11-02 17:00ZZ3020010610021313613178056524812434
52020-11-02 17:00ZZ3020010610021313613178056524912433
62020-11-02 17:00ZZ3020010610021313613178056525012434
72020-11-02 17:00ZZ3020010610021313613178056525112435
82020-11-02 17:00ZZ3020010610021313613178056525212437
92020-11-02 17:00ZZ3020010610021313613178056525312438
102020-11-02 17:00ZZ3020010610021313613178056525412435
112020-11-02 17:00ZZ3020010610021313614178056525613584
122020-11-02 17:00ZZ3020010610021313614178056525713586
132020-11-02 17:00ZZ3020010610021313614178056525813582
142020-11-02 17:00ZZ3020010610021313614178056525913582
152020-11-02 17:00ZZ3020010610021313614178056526013583
162020-11-02 17:00ZZ3020010610021313614178056526113585
172020-11-02 17:00ZZ3020010610021313614178056526213587
182020-11-02 17:00ZZ3020010610021313614178056526313586
192020-11-02 17:00ZZ3020010610021313614178056526413586
202020-11-02 17:00ZZ3020010610021313614178056526513582
212020-11-02 17:00ZZ3020010610021313615178056526712321
222020-11-02 17:00ZZ3020010610021313615178056526812323
232020-11-02 17:00ZZ3020010610021313615178056526912322
242020-11-02 17:00ZZ3020010610021313615178056527012323
252020-11-02 17:00ZZ3020010610021313615178056527112324
262020-11-02 17:00ZZ3020010610021313616178056527513213
272020-11-02 17:00ZZ3020010610021313616178056527613212
282020-11-02 17:00ZZ3020010610021313616178056527713214
292020-11-02 17:00ZZ3020010610021313616178056527813213
302020-11-02 17:00ZZ3020010610021313616178056527913214
312020-11-02 17:00ZZ3020010610021313616178056528013215
322020-11-02 17:00ZZ3020010610021313616178056528113217
332020-11-02 17:00ZZ3020010610021313616178056528213218
342020-11-02 17:00ZZ3020010610021313616178056528313215
352020-11-02 17:00ZZ3020010610021313617178056528612033
362020-11-02 17:00ZZ3020010610021313617178056528712032
372020-11-02 17:00ZZ3020010610021313617178056528812034
382020-11-02 17:00ZZ3020010610021313617178056528912033
392020-11-02 17:00ZZ3020010610021313617178056529012034
402020-11-02 17:00ZZ3020010610021313617178056529112035
412020-11-02 17:00ZZ3020010610021313617178056529212037
422020-11-02 17:00ZZ3020010610021313617178056529312038
432020-11-02 17:00ZZ3020010610021313617178056529412035
442020-11-02 17:00ZZ3020010610021313618178056529510436
452020-11-02 17:00ZZ3020010610021313618178056529610432
462020-11-02 17:00ZZ3020010610021313618178056529710433
472020-11-02 17:00ZZ3020010610021313618178056529810434
482020-11-02 17:00ZZ3020010610021313618178056529910432
492020-11-02 17:00ZZ3020010610021313618178056530010433
502020-11-02 17:00ZZ3020010610021313618178056530110434
512020-11-02 17:00ZZ3020010610021313618178056530210431
data


Thanks

Neil
 

Attachments

  • Capture.JPG
    Capture.JPG
    23.9 KB · Views: 6
Upvote 0
Thank you
It is not immediately obvious what goes where
Please help
 
Upvote 0
Hi Yongle - thanks fro trying to understand my poor explaination

ok:
1. rows 2-10 contain the same "code" in Column D - that is, 9 instances of that code.
2. so, I would like, from the user form, to paste the values in the textboxes alongside "Line9" into those rows (textboxes 37-45)
3. rows 11-20 contain a different "same" code - that is 10 instances of the code .
4. so, I would like, from the userform, to paste the values in the textboxes alongside "line10" into those rows(textboxes 46-55)

and so on..

have i explained myself a little better?

thanks for helping

Neil
 
Upvote 0
Maybe ?
I will look later when I have some more time
 
Upvote 0
Bump.
Wonder if anyone had a way to do this?

Thanks

Neil
 
Upvote 0
I am not able to fully understand what you want so cannot help you. Sorry
 
Upvote 0
This question is duplicate, and closed now for further replies since the duplicated one has more details.

@neilp - please do not post the same question as a new thread. If you will provide more details, then please do that in the same thread instead creating a new one. Otherwise the helpers who are already trying to understand your question will never know that you posted a duplicate thread.
Please read the Message Board Rules carefully - Rule #12.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,523
Messages
6,120,028
Members
448,940
Latest member
mdusw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top