Hey all,
I have written the code below to (from a ComboBox filled with the values in column A) Fill a series of TextBoxes with information from cells in the same row as the value (Selcted from the ComboBox).
The code works fine however I also need to be able to change the values that appear in the TextBoxes and have the actual cell change Also.
Basically I want to be able to manage my spreadsheet entirely from this Userform.
So I have a ComboBox that is filled by the values in column A
when the Command Button is Clicked it fills All 13 TextBoxes with the information relevant to the ComboBox Selection.
All values are in the same row as the ComboBox Referace
Thanks in Advance
--imav
I have written the code below to (from a ComboBox filled with the values in column A) Fill a series of TextBoxes with information from cells in the same row as the value (Selcted from the ComboBox).
The code works fine however I also need to be able to change the values that appear in the TextBoxes and have the actual cell change Also.
Basically I want to be able to manage my spreadsheet entirely from this Userform.
Code:
Private Sub CommandButton1_Click()
TextBox1.Value = Worksheets("RLATAM").Columns(1).Find(ComboBox1.Value).Offset(0, 1).Value
TextBox2.Value = Worksheets("RLATAM").Columns(1).Find(ComboBox1.Value).Offset(0, 16).Value
TextBox3.Value = Worksheets("RLATAM").Columns(1).Find(ComboBox1.Value).Offset(0, 17).Value
TextBox4.Value = Worksheets("RLATAM").Columns(1).Find(ComboBox1.Value).Offset(0, 18).Value
TextBox5.Value = Worksheets("RLATAM").Columns(1).Find(ComboBox1.Value).Offset(0, 19).Value
TextBox6.Value = Worksheets("RLATAM").Columns(1).Find(ComboBox1.Value).Offset(0, 20).Value
TextBox7.Value = Worksheets("RLATAM").Columns(1).Find(ComboBox1.Value).Offset(0, 21).Value
TextBox8.Value = Worksheets("RLATAM").Columns(1).Find(ComboBox1.Value).Offset(0, 22).Value
TextBox9.Value = Worksheets("RLATAM").Columns(1).Find(ComboBox1.Value).Offset(0, 23).Value
TextBox10.Value = Worksheets("RLATAM").Columns(1).Find(ComboBox1.Value).Offset(0, 24).Value
TextBox11.Value = Worksheets("RLATAM").Columns(1).Find(ComboBox1.Value).Offset(0, 25).Value
TextBox12.Value = Worksheets("RLATAM").Columns(1).Find(ComboBox1.Value).Offset(0, 59).Value
TextBox13.Value = Worksheets("RLATAM").Columns(1).Find(ComboBox1.Value).Offset(0, 60).Value
End Sub
Private Sub UserForm_Initialize()
Dim wsSheet As Worksheet
Dim rngNext As Range
Dim myRange As Range
Set wsSheet = ActiveSheet
With wsSheet
Set rngNext = .Range("A65536").End(xlUp)
End With
rngNext.Select
Set myRange = Range("A5", rngNext)
With ComboBox1
For Each rngNext In myRange
If rngNext <> "" Then .AddItem rngNext
Next rngNext
End With
End Sub
So I have a ComboBox that is filled by the values in column A
when the Command Button is Clicked it fills All 13 TextBoxes with the information relevant to the ComboBox Selection.
All values are in the same row as the ComboBox Referace
Thanks in Advance
--imav