Results 1 to 16 of 16

Help me develop function to find the number having repeated time is max...

Threaded View

  1. #1
    Forum Contributor
    Join Date
    11-21-2015
    Location
    Philippines
    MS-Off Ver
    Microsoft Office 2016
    Posts
    146

    Help me develop function to find the number having repeated time is max...

    I want to find the number having repeated time is max in the range which is limited by min and max number. So I try to develop a function but it can not run.
    Help me pls,
    Thank you so much
    Function xxx(x As Integer, y As Integer, dl As Variant) As Integer
    Dim a As Integer, b As Integer
            ReDim DL2(1 To UBound(dl), 1 To 2)
            Set Dic = CreateObject("Scripting.Dictionary")
            With Dic
            a = 1
            For j = 1 To UBound(dl, 2)
                For i = 1 To UBound(dl, 1)
                Tmp = dl(i, j)
                    If Tmp >= x And Tmp <= y Then
                        If Not .exists(Tmp) Then
                            k = k + 1
                            .Add Tmp, k
                            DL2(k, 1) = dl(i, j)
                            DL2(k, 2) = 1
                        Else
                            Rws = Dic.Item(Tmp)
                            DL2(Rws, 2) = DL2(Rws, 2) + 1
                            If DL2(Rws, 2) >= a Then
                                a = DL2(Rws, 2)
                                b = DL2(Rws, 1)
                            End If
                        End If
                    End If
                Next
            Next
            End With
    xxx = b
    End Function
    Attached Files Attached Files
    Last edited by tamthat; 06-27-2018 at 01:35 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 10-11-2014, 04:52 AM
  2. To find repeated trailer number ? Help
    By Jeeves50 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-12-2013, 08:25 PM
  3. Develop a VBA code to get the output - find the mean of every 50 lines of row data.
    By cadcraft in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-29-2013, 10:29 AM
  4. How to Develop a Break Time Calculator with Buttons
    By vrindamithul in forum Excel General
    Replies: 0
    Last Post: 02-10-2013, 07:32 AM
  5. [SOLVED] Function required to develop algorithm
    By Karnik in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-06-2013, 04:58 PM
  6. poiting a certain number to identify how many time it is repeated
    By spolonova in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-02-2011, 03:19 AM
  7. find out number repeated max. times in column.
    By vimivijay in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-10-2005, 06:59 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1