I have a workbook that houses Client information. There is a sheet for each Client, and each sheet is labeled with the Client's unique ID. I'm wanting to launch a UserForm where the User will select a Client from a cobo box. Then, data from the last row of the appropriate sheet populates the UserForm.
In other code within the same workbook, I'm using a scripting dictionary, but those all tie to a specific range, in a specific sheet. I have no clue how to code for the UserForm to search across all sheets to find the one that has the same name as the value in the cobo_ClientID field, and then bring in the correct data elements from the row with the MAX updated date.
Here's an example of the scripting dictionary that I've been using in other areas:
Set coboDict = CreateObject("Scripting.Dictionary")
With coboDict
For Each cStatsClientID In ws1.Range("StatsClientID")
If Not .exists(cStatsClientID.Value) Then
.Add cStatsClientID.Value, cStatsClientID.Row
Else
If CLng(cStatsClientID.Offset(, -2).Value) > CLng(ws1.Range("B" & .Item(cStatsClientID.Value))) Then
.Item(cStatsClientID.Value) = cStatsClientID.Row
End If
End If
Next cStatsClientID
Me.cobo_ClientID.List = Application.Transpose(.keys)
End With