![]() |
Pulling data into textbox from spreadsheet
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 Any thoughts on how to make this match the month then bring in the data in another column? |
All times are GMT +1. The time now is 03:55 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com