I didn't notice that he had said that Andy, but I still think he shouldn't. The form is a class, Me refers to the class, so use it. Why do you need to know the name when you are in the class? Plus, it is another place to modify if you change the name of the variable.
As for not using me to...
As well as combo's comments, you shouldn't reference the form within the form code using the form variable, use the Me keyword instead.
Here is how I would do it.
Module code
Global strMonth As String 'Procedure starts here
Global sMonth As UserForm1 'Change to your...
My view is that it is okay to post in multiple forums, but if you do, tell each forum about the other posts. That way potential responders can check to see whether a good answer has already been provided, or even pass on trying to respond. If you want help, show some respect.
On a style note, in the code such as
' Collections (column Y)
If Range("F" & n).Value = "Collections" And Emp <> "EP" Then Worksheets(DSW1).Cells(c, 25).Value = Emp: c = c + 1
If Range("F" & n).Value = "Collections" Then Worksheets(DSW1).Cells(cg, 51).Value = Emp: cg = cg + 1...
I tend to agree with combo that Power Query is the way to go, it should be quite simple using grouping, but should you want a VBA solution, here is my offering
Public Sub DescriptionMerge()
Dim calcmode As Long
Dim lastrow As Long
Dim i As Long
Application.ScreenUpdating = False...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.