View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default most popular keyword

This should do it for you:

Sub Count1()
Dim lRow As Long, i As Long, j As Long
Dim C As Range, Lst As Range

lRow = ActiveSheet.Cells(Rows.count, "A").End(xlUp).Row
Set Lst = Range("A1:A" & lRow)

For Each C In Lst
If C.Value = "" Then GoTo skip
C.Offset(0, 1).Value = 1
If C.Row = 1 Then GoTo skip
If C.Value = C.Offset(-1, 0).Value Then
C.Offset(0, 1).Value = C.Offset(-1, 1).Value + 1
End If
skip:
Next C
End Sub


Sub Count2()
Dim lRow As Long, i As Long, j As Long
Dim C As Range, Lst As Range

lRow = ActiveSheet.Cells(Rows.count, "A").End(xlUp).Row
Set Lst = Range("A1:A" & lRow)

For Each C In Lst
If C.Value = "" Then GoTo skip
C.Offset(0, 1).Value = 1
If C.Row = 1 Then GoTo skip
If C.Value = C.Offset(-1, 0).Value Then
C.Offset(0, 1).Value = C.Offset(-1, 1).Value + 1
End If
skip:
Next C
End Sub

HTH,
Ryan---
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Tony_student" wrote:

How to define the most popular keyword within one list?