PDA

View Full Version : [SOLVED:] Count number of occurrences via combobox in user form



mml
08-24-2020, 08:14 PM
Hello
Working to get some things automated .On a basic spread sheet I am required to count the number of times a value is entered onto this sheet. This can run into the hundreds. I have tried to simplify with user form but have not been able to find the VBA code to get the " count " of number of times a value is recorded. eg if 12 is selected from combox then the number of times it has been recorded appears in a corresponding field.
I have seen result via pivot table or via list thought possibly in correctly that this could be done via a userform.
Hoping that this is a simple task ???
Thank you for your time

SamT
08-24-2020, 10:06 PM
Dim FullCount As long

Private Sub Combobox_Event
'
'
'
FullCount = FullCount + ComboBoxCount
'
'
'End Sub

snb
08-25-2020, 01:06 AM
See

or

mml
08-25-2020, 09:23 PM
Ok thanks to you both for taking the time providing a solution
I have learnt two things which is appreciated :

1. how to format a better list box -
2. part of the count sub vba

Works perfectly and and will save a ton of time