Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET - can i use it to build dynamic Excel forms? [email protected] Excel Programming 0 August 25th 06 11:08 PM
Dynamic Userform problem... Alex Excel Programming 0 March 26th 06 11:50 PM
dynamic userform masterphilch Excel Programming 1 November 7th 05 01:00 PM
create a userform to populate a diagram with the forms info Mic Excel Discussion (Misc queries) 0 July 22nd 05 08:07 PM
help creating dynamic forms mas Excel Programming 1 March 12th 05 05:21 PM


All times are GMT +1. The time now is 08:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"