Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-11-2011, 10:38 PM
macropod's Avatar
macropod macropod is offline HLOOKUP, if,? OR MACRO Windows 7 32bit HLOOKUP, if,? OR MACRO Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Bobby,

With your raw data in Sheet 1 and the list of welders in Sheet2 (col A), you could use the following macro:
Code:
Sub Summarize()
Application.ScreenUpdating = False
Dim i As Long, j As Long, k As Long
Dim StrName As String, iTally As Long
With ThisWorkbook.Sheets("Sheet2")
  For i = 2 To .Range("A" & .Rows.Count).End(xlUp).Row
    StrName = .Range("A" & i).Value
    iTally = 0
    With ThisWorkbook.Sheets("Sheet1")
      For j = 2 To .Range("A" & .Rows.Count).End(xlUp).Row
        For k = 2 To .Cells.SpecialCells(xlCellTypeLastCell).Column
          If .Cells(j, k).Value = StrName Then
            iTally = iTally + 1
            Exit For
          End If
        Next
      Next
    End With
    .Range("B" & i).Value = iTally
  Next
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
counta, countif, hlookup



Similar Threads
Thread Thread Starter Forum Replies Last Post
HLOOKUP, if,? OR MACRO Help with a macro Takket Word VBA 2 03-28-2014 04:58 PM
need a macro that does the following atomsk Word VBA 0 07-05-2010 07:29 AM
Please help Jarrod Word 1 06-05-2010 06:31 AM
I need a macro, who can help me? Bahir Barak Word VBA 1 05-26-2010 12:24 AM
Macro help NEHicks503 Excel 0 04-16-2010 07:29 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:07 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft