Urgent help needed! Create list from data of length entered into UserForm

AshaG

New Member
Joined
Jan 13, 2019
Messages
5
I'm still very new at vba and I'm learning by doing, but this is way over my head.

I've attached a link to my mock data. It is a item request list. One group of people adds to detail of the item in the first section (green in the workbook). The second group of people then pick up the item in batches at a later date. Some items are classed as non-urgent and is designated with PR in the column "PR?".

I am hoping to use a macro to create a pick up list (containing ID Number, Name, and Number columns) for the second group of people based on blanks in the "Item Picked Up" (i.e. items which have not been picked up yet). I'm wanting them to press a button (a green "Create Pick List" button to be on the far right) and have a UserForm pop up asking for the number of items they want on their pick list and check a box if they want to exclude PR items, then automatically return a list of the first x number (based on what was entered in the UserForm) items not yet picked up on the Pick List worksheet. The list needs to be

I have already created the UserForm layout in Visual Basics.

I hope this all makes sense. Any help would be beyond appreciated.

Thanks

https://www.dropbox.com/s/hszi184clw1ok8r/UR - Forum example data.xlsm?dl=0
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi & welcome to MrExcel.
How about
Code:
Private Sub AddAnotherButton_Click()
   With Sheets("Pick List")
      .Range("A2", .Range("A" & Rows.Count).End(xlUp).Offset(, 3)).ClearContents
   End With
   With Sheets("Requests")
      If .FilterMode Then .ShowAllData
      .Range("A2:L2").AutoFilter 10, "<>Yes"
      If Me.CheckBox1 Then .Range("A2:L2").AutoFilter 4, "<>PR"
      Intersect(.AutoFilter.Range, .Range("A:C")).Copy Sheets("Pick List").Range("A2")
      .ShowAllData
   End With
   With Sheets("Pick List")
      .Range("A" & 3 + Val(Me.PickNumTextBox.Value), .Range("A" & Rows.Count).End(xlUp).Offset(, 3)).ClearContents
   End With

End Sub
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

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