View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
tolgag[_47_] tolgag[_47_] is offline
external usenet poster
 
Posts: 1
Default Simple Code Required

Hi gregork,

1. To fill the combo box with a range, put the following code to
Private Sub UserForm_Initialize() event of the form.Should be look like
this :

Dim i as integer
For i = 3 to 200
Me.ComboBox1.AddItem Cells(i,1) 'i = Rownr 1 is the columnnr
next

2. To insert the data into the sheet, put this code to Private
Command1_OnClick() event of the Command1 Button :
If me.ComboBox1.Value<"" And Not IsNull(me.ComboBox1) And
Me.TextBox1.Value<"" And Not Isnull(Me.TextBox1) then
Cells(3,3) = Me.ComboBox.Value
Cells(3,18) = Me.TextBox1.Value
Else
Msgbox "Please complete form"
End if


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