XP, Excel 2010
I do community bookkeeping and I am a beginner at macros. This forum has been an incredible help! I try to find answers on my own, but this is WAY beyond me.
A volunteer here helped me with a consolidator code, but now it is too long.
It worked when I only had 400 clients to call. For example, I run the consolidator sub macro for client 399 and I get all the rows that have "399" in the first cell. That way I can see all of member 399's transactions in my accounting.
I also found on this forum a "AddToolbar" macro to call the sub from the consolidator macro. It created an "Add In" combo box and I could click which member I wanted so I didn't have to have 400 buttons. Again worked great till I had to add more members.
If anyone has time to help, I would greatly appreciate it!
Here is the consolidator code only for members 100 - 110. I have total 800 members.
You know why I get the error "Compile error: Procedure too large"!
You can see I am bringing all the rows from the worksheets "P"..."12" that have "100" (or which ever member number I want) in the first cell to worksheet "C".
This is a great code even for beginners, but I know there is a cleaner way to do it since I have so many members.
Thank you for any help!
I do community bookkeeping and I am a beginner at macros. This forum has been an incredible help! I try to find answers on my own, but this is WAY beyond me.
A volunteer here helped me with a consolidator code, but now it is too long.
It worked when I only had 400 clients to call. For example, I run the consolidator sub macro for client 399 and I get all the rows that have "399" in the first cell. That way I can see all of member 399's transactions in my accounting.
I also found on this forum a "AddToolbar" macro to call the sub from the consolidator macro. It created an "Add In" combo box and I could click which member I wanted so I didn't have to have 400 buttons. Again worked great till I had to add more members.
If anyone has time to help, I would greatly appreciate it!
Here is the consolidator code only for members 100 - 110. I have total 800 members.
You know why I get the error "Compile error: Procedure too large"!
Code:
Option Explicit
Const strShtCmn As String = "C"
Private Sub Consolidator(SheetName As String, RowNo As Long, Match As String)
Dim sh As Worksheet
Dim r As Object, j As Long
Dim cs As Worksheet
ActiveWindow.ScrollRow = RowNo - 3
Application.ScreenUpdating = False
Set cs = ThisWorkbook.Worksheets(SheetName)
For Each sh In ThisWorkbook.Worksheets
Select Case sh.Name
Case "P", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"
For Each r In sh.UsedRange.Rows
If UCase(r.Cells(1)) = Match Then
For j = 1 To 88
cs.Cells(RowNo, j) = r.Cells(j)
Next j
RowNo = RowNo + 1
End If
Next r
End Select
Next sh
cs.Range("A" & RowNo).Select
Set cs = Nothing
Application.ScreenUpdating = True
End Sub
Private Sub Consolidator_100()
Consolidator strShtCmn, 7, "100"
End Sub
Private Sub Consolidator_101()
Consolidator strShtCmn, 7, "101"
End Sub
Private Sub Consolidator_102()
Consolidator strShtCmn, 7, "102"
End Sub
Private Sub Consolidator_103()
Consolidator strShtCmn, 7, "103"
End Sub
Private Sub Consolidator_104()
Consolidator strShtCmn, 7, "104"
End Sub
Private Sub Consolidator_105()
Consolidator strShtCmn, 7, "105"
End Sub
Private Sub Consolidator_106()
Consolidator strShtCmn, 7, "106"
End Sub
Private Sub Consolidator_107()
Consolidator strShtCmn, 7, "107"
End Sub
Private Sub Consolidator_108()
Consolidator strShtCmn, 7, "108"
End Sub
Private Sub Consolidator_109()
Consolidator strShtCmn, 7, "109"
End Sub
Private Sub Consolidator_110()
Consolidator strShtCmn, 7, "110"
End Sub
This is a great code even for beginners, but I know there is a cleaner way to do it since I have so many members.
Thank you for any help!