Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dynamic forms in a macro userform
At the moment i am trying to dynamically type out a form.
By inputting the id of a user in textbox1 it looks in a1 to a2000 for the id. So say the value of a16 is returned, i want it to be able to write the value of b16 in textbox2. the same as if a256 was given b256 would be dynamically input in textbox2. Any idea on how i could do this. Private Sub TextBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean) With Worksheets("customer details").Range("a1:a2000") Set c = .Find(UserForm1.TextBox1.Value, LookIn:=xlValues) If Not c Is Nothing Then firstAddress = c.Address Do TextBox2.Value = c.value Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dynamic forms in a macro userform
Private Sub TextBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim iRow As Long With Worksheets("customer details") On Error Resume Next iRow = Application.Match(Me.TextBox1.Text, .Range("A1:A2000"), 0) On Error GoTo 0 If iRow 0 Then Me.textbox2.Text = .Range("B" & iRow).Value End If End With End Sub -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Sjakkie" wrote in message ... At the moment i am trying to dynamically type out a form. By inputting the id of a user in textbox1 it looks in a1 to a2000 for the id. So say the value of a16 is returned, i want it to be able to write the value of b16 in textbox2. the same as if a256 was given b256 would be dynamically input in textbox2. Any idea on how i could do this. Private Sub TextBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean) With Worksheets("customer details").Range("a1:a2000") Set c = .Find(UserForm1.TextBox1.Value, LookIn:=xlValues) If Not c Is Nothing Then firstAddress = c.Address Do TextBox2.Value = c.value Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dynamic forms in a macro userform
TextBox2.Value = c.Offset(,1).Value
HTH Charles Chickering Sjakkie wrote: At the moment i am trying to dynamically type out a form. By inputting the id of a user in textbox1 it looks in a1 to a2000 for the id. So say the value of a16 is returned, i want it to be able to write the value of b16 in textbox2. the same as if a256 was given b256 would be dynamically input in textbox2. Any idea on how i could do this. Private Sub TextBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean) With Worksheets("customer details").Range("a1:a2000") Set c = .Find(UserForm1.TextBox1.Value, LookIn:=xlValues) If Not c Is Nothing Then firstAddress = c.Address Do TextBox2.Value = c.value Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ASP.NET - can i use it to build dynamic Excel forms? | Excel Programming | |||
Dynamic Userform problem... | Excel Programming | |||
dynamic userform | Excel Programming | |||
create a userform to populate a diagram with the forms info | Excel Discussion (Misc queries) | |||
help creating dynamic forms | Excel Programming |