As the title says, is there a way to display something like "Unique values: 3" on the Status Bar if I select 6 cells with values 1, 1, 2, 2, 3, 3?
As the title says, is there a way to display something like "Unique values: 3" on the Status Bar if I select 6 cells with values 1, 1, 2, 2, 3, 3?
多么想要告诉你 我好喜欢你
yes it is.
You shall prepare a code for Selectionchange event for given worksheet
For instance it shall work:
![]()
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim x&, rng As Range, NoDupes As New Collection For Each rng In Target If Len(rng.Text) > 0 Then On Error Resume Next NoDupes.Add 1, rng.Text If Err.Number = 0 Then x = x + 1 Else Err.Clear End If End If Next rng Application.StatusBar = IIf(x = 0, "", "unique values: " & x) End Sub
Thanks Andy, never did anything to do with class modules before. Will look into that.
Thanks Kaper, I was looking for something application-wide. Your input may still benefit someone else though.
With application-wide you indeed shall probably base on Andy's link and possibly use some of my code.
For those who look for "somewher in the middle" solution (Workbook-wide ;-) ) let me mention, that there is an option to use the same as above procedure, but in ThisWorkbook code (not particular Sheet) and then it shall be
![]()
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks