View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
RPIJG[_44_] RPIJG[_44_] is offline
external usenet poster
 
Posts: 1
Default Question about ComboBox/Userform/TextBox etc.

Thanks for trying to help me out here, so I tried it out, this is wha
I've got so far...but I'm getting a compile error sub or function no
defined at
Code
-------------------
Private Sub AddName_Click(
-------------------
here is the what I've got...


Code
-------------------
Private Sub AddName_Click()
Dim i As Long, ii As Long, Found As Boolean
Found = False
For i = 0 To NameBox.ListCount - 1
If NameBox.List(i) = NameBox.Text Then
Found = True
Exit For
End If
Next
If Found Then
For ii = 1 To 5
Controls("TextBox" & ii).Text = Cells(Rng(i + 1).Row, ii + 1)
Next
Else
Cells(Rw + 1, 1).Value = NameBox.Value
For i = 1 To 5
Cells(Rw + 1, i + 1) = Controls("TextBox" & i).Text
Next
End If
Rw = Range("A65536").End(xlUp).Row
Set Rng = ActiveSheet.Range(Cells(5, 1), Cells(Rw, 1))
NameBox.RowSource = Rng.Address
End Su
-------------------


And the other piece in...


Code
-------------------
Private Sub UserForm_Initialize()
Dim Rng As Range, Rw As Long
Rw = Range("A65536").End(xlUp).Row
Set Rng = ActiveSheet.Range(Cells(5, 1), Cells(Rw, 1))
NameBox.RowSource = Rng.Address
End Su
-------------------


--
Message posted from http://www.ExcelForum.com