Hi, Everyone,
I have a worksheet that includes 8 columns. Column 2 is the index. Column 3 has IDs.
Given an ID, I want to know how many rows in the worksheet include the ID in Column 3.
If more than one row, I want to load each such row into a ComboBox so I can then select the row I want to work with.
So far, I’ve been able to count the rows that have the ID in question. But I can’t figure out how to load the rows into a ComboBox. I’d be grateful for any help!
Private Sub cmd3_Click()
Dim strID As String
Dim qAuth As Integer
Dim rng As Range, c
' [Deleted code to determine and set strID]
' Determine number of rows associated with strID
Set rng = Range("Sheet2")
qAuth = 0
For c = 2 To rng.Rows.Count
If rng.Cells(c, 3) = strID Then
qAuth = qAuth + 1
'While going through the rows, this might be a good time to gather data for the
'ComboBox, but how?
End If
Next c
Select Case qAuth
Case 0
' [Deleted]
Case 1
' [Deleted]
Case Else
' Load the ComboBox cbRows in the Form frmSelect (but how?)
frmSelect.Show
End Select
End Sub
Bookmarks