Solved: Filter data and count unique
In the attached sheet("AuditIssues"), there is one button that says, "Analyze Data". Clicking it brings up the userform "Active Issues Analysis"; it has one combo box and 2 text values. I need help with following:
1) Combo box: In the choose period combo box, I want to be able to choose 4-types of date (issues that are 0 to 30 days old from today, 31 to 60 from today, 61 to 90, 91 to 120 from today and more than 121 days from today BASED ON COLUMN B AND the value "Active" from column H.
2) Text Box1: I want to count "Active" from column H based on the filtered data.
3) Text Box 2: Count no. of unique numbers from column A.
I need to make the range in column A, B and H to be dynamic, I don't know how to set the dynamic ranges in macro. Can some please help me? Thanks.
Keep autofilter feature / show MsgBox
Hi,
I need some more modifications in the code as described below:
1) For some reason, I always need to keep the autofilter mode in the sheet. So I think following code needs to be modified. As for the textbox values, can it always show the counts of "Active" as wells as "Station Numebrs"?
[vba]Private Sub CommandButton1_Click()
With Me
If .AutoFilterMode = True Then
.AutoFilterMode = False
TextBox1.Text = ""
TextBox2.Text = ""
End If
End With
End Sub[/vba]
2) I need a MsgBox when any macro chosen from CmbBox results in No Data. Example. Selecting "Active Issues 61 to 90 days old" result in zero data. The message should say "No data". One of the code I am using to call macro from combobox selection is posted below. How can this code be modified?
[vba]Sub ActiveSixtyOneToNinety()
'
' ActiveZeroToThirty Macro
' Macro recorded 4/16/2008 by ushrestha'
Application.ScreenUpdating = False
If ActiveSheet.FilterMode = True Then
ActiveSheet.ShowAllData
End If
Selection.AutoFilter Field:=16, Criteria1:="Active61-90"
Application.ScreenUpdating = True
End Sub[/vba]
I do not know how to remove "Solved" in the headline. I would really appreciate your help. Thanks.