W
Wiggler
I posted this once but did not see it, I apoligise if it is a duplicate
post.
I have a multipage userform that has several drop down boxes that the user
needs to populate (name, month etc..) from that I have text boxes that I
want to populate from another spreadsheet located in the same file.
I need to use an If-then because I want it too look until it finds a match
to the month and then bring in column 3.
I have the textbox set to refresh on _chg action of the dropdown and it is
bringing in the first row but will not find the match. The code is included.
Sub Populate04selldays()
Dim Row As Integer, i As Long, j As Long
Set selling = ThisWorkbook.Sheets("Selling")
TopicCount = Application.WorksheetFunction.CountA(selling.Range ("A:A"))
For Row = 1 To TopicCount
If selling.Cells(Row, 1) = cbmonth.Value Then
tb04selldays.Value = selling.Cells(Row, 3).Value
End If
Next Row
CurrentTopic = 1
End Sub
post.
I have a multipage userform that has several drop down boxes that the user
needs to populate (name, month etc..) from that I have text boxes that I
want to populate from another spreadsheet located in the same file.
I need to use an If-then because I want it too look until it finds a match
to the month and then bring in column 3.
I have the textbox set to refresh on _chg action of the dropdown and it is
bringing in the first row but will not find the match. The code is included.
Sub Populate04selldays()
Dim Row As Integer, i As Long, j As Long
Set selling = ThisWorkbook.Sheets("Selling")
TopicCount = Application.WorksheetFunction.CountA(selling.Range ("A:A"))
For Row = 1 To TopicCount
If selling.Cells(Row, 1) = cbmonth.Value Then
tb04selldays.Value = selling.Cells(Row, 3).Value
End If
Next Row
CurrentTopic = 1
End Sub