Olufunke has attended:
Access VBA course
Excel VBA Intro Intermediate course
Functions
how to do unique counts
RE: functions
Hi Olufunke
Thank you for your question
Could you please clarify the following for me
1. What is it you are counting?
2. Are you working in Access or Excel
Thanks
Stephen
RE: functions
Hi Olufunke,
This question has now been left unattended for a while.
We like to keep down the large number of active forum posts we receive.
As we are waiting for your response for further information to help resolve your issue, we will be automatically marking this question as resolved in the next 5 days (unless you post a follow-up within that time).
We look forward to hearing from you.
Thank you.
Regards, Rich
RE: functions
The count is in Excel
1. A client might have more than one records
2. I might filter for certain parament,, based on that parameter I also want to do a unique count on the remainder of the records
Hope this makes sense
Regards
Funke
RE: functions
Hi Olufunke
Thanks for the update
If I understand correctly you want to filter your record on a certain criteria (e.g. Client Name) and then count how many records there are that match this. You then also want to know how many additional records there are.
This is quiet a complex thing to do in code, but the general strategy would be to:
1. Use the count method of the rows collection of the current region to determine how many records there are in total, and assign this to a variable (intTotalCount)
2. Use the filter method of the selection object to filter the data. (I suggest recording a macro to see the code for this)
3. Then repeat step 1 for the filtered data saving that to a variable(intFilterCount)
IntFilterCount will give you the number of items in the filtered data and that less intTotalCount will give you the balance
If you have any problems please do follow up to my post
Regards
Stephen