Get templates files and copy data to it

F

franciz

Hi Joel

This is Fantastic!! You have been an excellent help.
Possible to have a message box that show the numbers of items
process for each name such as :
"Total for files process AB : 9. MY : 2, and so on" ?

How could I get started to learn coding in macro? I have a few good books on
this subject but doesn't seem to be able to get started on this.

thank you very much on all the help you have given. Appreciate very much!

cheers, francis
 
J

Joel

This code will get unique items in column C and give a total.

Sub ItemsProcessed()

With ActiveSheet
Lastrow = .Range("C" & Rows.Count).End(xlUp).Row
Set People = .Range("C2:C" & Lastrow)

If .FilterMode = True Then
.ShowAllData
End If

.Columns("C:C").AdvancedFilter _
Action:=xlFilterInPlace, Unique:=True

Set UniquePeople = People.SpecialCells(Type:=xlCellTypeVisible)

MessageString = ""
For Each Person In UniquePeople
CountItems = WorksheetFunction.CountIf(People, Person)
If MessageString = "" Then
MessageString = Person & " : " & CountItems
Else
MessageString = MessageString & Chr(13) & Person & " : " & CountItems
End If
Next Person

If .FilterMode = True Then
.ShowAllData
End If
End With
MsgBox (MessageString)


End Sub
 
F

franciz

Thank you! Joel

cheers, francis

Joel said:
This code will get unique items in column C and give a total.

Sub ItemsProcessed()

With ActiveSheet
Lastrow = .Range("C" & Rows.Count).End(xlUp).Row
Set People = .Range("C2:C" & Lastrow)

If .FilterMode = True Then
.ShowAllData
End If

.Columns("C:C").AdvancedFilter _
Action:=xlFilterInPlace, Unique:=True

Set UniquePeople = People.SpecialCells(Type:=xlCellTypeVisible)

MessageString = ""
For Each Person In UniquePeople
CountItems = WorksheetFunction.CountIf(People, Person)
If MessageString = "" Then
MessageString = Person & " : " & CountItems
Else
MessageString = MessageString & Chr(13) & Person & " : " & CountItems
End If
Next Person

If .FilterMode = True Then
.ShowAllData
End If
End With
MsgBox (MessageString)


End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top