This a new question that arised from my earlier posting in http://www.ozgrid.com/forum/showthread.php?t=86050
have the following working code below, but am having trouble finding coding examples to select specific cells from the
selected row (that was found by selecting a ComboBox value)and update TextBoxes with those individual values after the
UserForm has been initialized (the bold "GREEN" comment in the code below). I have been able to find plenty of references to
update TextBox values to Cells, but that doesn't do me much good in this application since the User needs to verify the old
data in these cells before updating them using the UserForm TextBoxes.
I was toying around with several different
variations of code (none of which worked properly), so I left it out for clarity of my working code. I'll post up this
non-working code as needed, because I really wanted a fresh answer...not what I was trying to do. The attached file should
be sufficient to see what's going on, but if not please ask questions.
Private Sub UserForm_Initialize()
'Add list entries to the combo boxes. The value of each
'box matches the existing SR Information spreadsheet entries
With Sheets("SR Information")
.Range("A2", .Cells(Rows.Count, "A").End(xlUp)).Name = "MyRange"
SRnumber.RowSource = "MyRange"
' Set initial values to TextBoxes -not needed, just for testing-
' NBdate.Text = "Test NBD SR Number"
' ApartNumber.Text = "Test AP SR Number"
' UPdetails.Text = "Test UD SR Number"
Private Sub SRnumber_Change()
Dim ServiceRequestNumber As String
Dim c As Range
Dim rngG As Range
'Find value in ComboBox, and select row
ServiceRequestNumber = SRnumber.Value
For Each c In Intersect(ActiveSheet.UsedRange, Columns("a"))
If c = ServiceRequestNumber Then
If rngG Is Nothing Then Set rngG = c.EntireRow
Set rngG = Union(rngG, c.EntireRow)
[B][COLOR="Red"] ' >Insert Code Here?< Update other TextBoxes with information contained in specific cells on the
If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines