如何计算一个值的出现次数和数组中相邻单元格的值

请多多包涵。 我目前正在计算出现在数组中的值的出现次数。我现在不仅要计算出现的次数,还要计算在同一行的相邻单元格中的int值……在数组中可能存在同一值的多次出现,并且还有多个不同的值比赛。

这是我当前的代码。 (无论好坏)。

我是否需要获取每个事件的单元格地址并使用它来获取同一行上的其他内容?

 ' Go through the array
For Each addDuty In arr
    ' Count if the name is found
    If addDuty = "AD PAINTING W/W" Then

     addDuty.Address
        PaintWWCnt = PaintWWCnt + 1

       ElseIf addDuty = "AD PAINTING LINES" Then
        PaintLineCnt = PaintLineCnt + 1

        ElseIf addDuty = "AD PAINITNG H/R" Then
        PaintHRCnt = PaintHRCnt + 1

        ElseIf addDuty = "AD PAINTING M/H" Then
        PaintMHCnt = PaintMHCnt + 1

        ElseIf addDuty = "AD M/HOOK GREASING" Then
        MHookGrseCnt = MHookGrseCnt + 1

        ElseIf addDuty = "AD M/HOOK MAINTENANCE" Then
        MHookMaintCnt = MHookMaintCnt + 1

        ElseIf addDuty = "AD M/HOOK EXCERSIZING" Then
        MHookExerCnt = MHookExerCnt + 1

        ElseIf addDuty = "AD MESSENGER LINES" Then
        MsngrLineCnt = MsngrLineCnt + 1

        ElseIf addDuty = "AD BERTH CHECKS" Then
        BerthChksCnt = BerthChksCnt + 1

        ElseIf addDuty = "AD BERTH STORES" Then
        BerthStrsCnt = BerthStrsCnt + 1

        ElseIf addDuty = "AD JETTY STORES" Then
        JettyStrsCnt = JettyStrsCnt + 1

        ElseIf addDuty = "AD L/A GREASING" Then
        LAGrseCnt = LAGrseCnt + 1

        ElseIf addDuty = "AD FUNCTION TESTS" Then
        FnctTestCnt = FnctTestCnt + 1

        ElseIf addDuty = "AD HOUSEKEEPING VEHICLES" Then
        HKVehclsCnt = HKVehclsCnt + 1

        ElseIf addDuty = "AD HOUSEKEEPING DOLPHINS" Then
        HKDolphsCnt = HKDolphsCnt + 1

        ElseIf addDuty = "AD HOUSEKEEPING ROADS" Then
        HKRoadsCnt = HKRoadsCnt + 1

        ElseIf addDuty = "AD HOUSEKEEPING BERTHS" Then
        HKBrthsCnt = HKBrthsCnt + 1

        ElseIf addDuty = "AD HOUSEKEEPING MARINE OFFICE" Then
        HKMrneOffcCnt = HKMrneOffcCnt + 1

        ElseIf addDuty = "AD LUB WINCH PEDALS" Then
        LubWnchPdlCnt = LubWnchPdlCnt + 1

        ElseIf addDuty = "AD GANGWAY CHECKS" Then
        GngywayChksCnt = GngywayChksCnt + 1

        ElseIf addDuty = "AD GANGWAY MAINTENANCE" Then
        GngywayMaintCnt = GngywayMaintCnt + 1

        ElseIf addDuty = "AD BERTH 5 WIRE CHECKS" Then
        Brth5WireChksCnt = Brth5WireChksCnt + 1

        ElseIf addDuty = "AD LIFEBUOY CHECKS" Then
        LfebuyChcksCnt = LfebuyChcksCnt + 1

        ElseIf addDuty = "AD LIFEBUOY LIGHT CHECKS" Then
        LfebuyLightCnt = LfebuyLightCnt + 1

        ElseIf addDuty = "AD SAFETY CHAIN CHECKS" Then
        SftyChainChcksCnt = SftyChainChcksCnt + 1



    End If

Next addDuty 

谢谢。