Need help with using a prompt to re-assign categoies

SeanDamnit

Board Regular
Joined
Mar 13, 2011
Messages
151
Hello MrExcel,

I'm having difficulty figuring out where to begin with this project.

I have an inventory list that will usually be ~10k line items, each grouped in 4-6 unique categories, with about 80 unique items. I will occasionally need to re-categorize items on this list. For the sake of a simple example, let's say it looks like this:

Excel Workbook
AB
1ItemCategory
2Cherry2
3Pear1
4Cherry2
5Pineapple2
6Apple3
7Banana1
8Banana1
9Kiwi1
10Kiwi1
11Cherry2
12Banana1
13Cherry2
14Apple3
15Apple3
16Cherry2
17Apple3
18Cherry2
Sheet2


What I'd like the process to do is:

For each unique category, a prompt will pop up listing each unique item in that category along with a drop down menu next to it giving the user the option to re-categorize that item. All items are set to their current category by default. Once complete the category would be updated in the data, and I can continue with the remaining requirements for my process.

Normally for projects like this I'm able to find a tutorial or something to get me started out there...but I guess my Google skills just aren't on game today. Can anyone point me in the right direction?

I appreciate any help! Thanks!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Without building a complete project for you, here is a starter. Say you want to change the category of Apple from 3 to 4. AutoFilter your data for column A = Apple. Select the visible cells in column B, go to the Formula Bar, type 4 and press Ctrl+Enter. Then clear the AutoFilter.

Here is the equivalent VBA code:

Code:
Sub Test()
    Dim Rng As Range
    With Range("A1").CurrentRegion
        .AutoFilter
        .AutoFilter Field:=1, Criteria1:="Apple"
        Set Rng = .Parent.AutoFilter.Range
        Set Rng = Rng.Offset(1).Resize(.Rows.Count - 1)
        Rng.Columns(2).SpecialCells(xlCellTypeVisible).Value = 4
        .Parent.AutoFilterMode = False
    End With
End Sub
 
Upvote 0
Without building a complete project for you, here is a starter. Say you want to change the category of Apple from 3 to 4. AutoFilter your data for column A = Apple. Select the visible cells in column B, go to the Formula Bar, type 4 and press Ctrl+Enter. Then clear the AutoFilter.

Here is the equivalent VBA code:

Code:
Sub Test()
    Dim Rng As Range
    With Range("A1").CurrentRegion
        .AutoFilter
        .AutoFilter Field:=1, Criteria1:="Apple"
        Set Rng = .Parent.AutoFilter.Range
        Set Rng = Rng.Offset(1).Resize(.Rows.Count - 1)
        Rng.Columns(2).SpecialCells(xlCellTypeVisible).Value = 4
        .Parent.AutoFilterMode = False
    End With
End Sub

The prompt is the part that's giving me the most trouble - any advice, tutorials, etc for that?
 
Upvote 0
What sort of prompt do you envisage? Here is some code that populates a ListBox with unique items:

Spreadsheet Page Excel Tips: Filling A Listbox With Unique Items

Awesome, wasn't familiar with collections or userforms, so this is a great start. What I envision is this...for each unique category, there will be a userprompt that looks like this:

2njx6vk.png


Labels on the left are each unique item in that category - drop down list on the right are a list of the categories, filled in with the initial category by default. The user has the option to change the category, which will then be updated in the data.

Pretty sure this is within my capability once I learn a little more on how to build userforms. Reading up now. I'll come back with specific questions if I have them - appreciate the help!
 
Upvote 0
It would be better to have one ComboBox for the Items and one ComboBox for the Categories with a CommandButton to change.
 
Upvote 0

Forum statistics

Threads
1,215,692
Messages
6,126,230
Members
449,303
Latest member
grantrob

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