View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default Populate sheet from userform

Try this - I wasn't sure about the rows but assumed they increased by 2 for
each name:

Private Sub CommandButton1_Click()
Dim j as long, i as integer
i = ComboBox1.ListIndex
j = ComboBox2.ListIndex
Worksheets("DM1").Cells((j * 2) + 4, i + 4) = _
Format (TextBox1.Value, "dd/mm/yyyy")
End Sub


Private Sub UserForm_Initialize()
Dim i as integer
For i = 5 To 20
ComboBox1.AddItem Worksheets("Input Sheet").Cells(i, "G")
Next i
cb2 = Array("f1", "f2", "ot1", "int", "f3", "f4", "summary", "o2")
For i = 0 To UBound(cb2)
ComboBox2.AddItem cb2(i)
Next i
End Sub

HTH

"cityfc" wrote:

I have problems

1, i have combo box 1 on a userform and what i want to do is list the names
from worksheet "input sheet" and are in column g5:g20

2 then in combo box 2 list f1, f2, ot1, int, f3, f4, summary, o2 then in a
text box user inserts date (and only a date) then presses ok

now the tricky bit

when ok is pressed if name "a" and "f1" is selected in combo boxes the date
is inserted to worksheet "DM1" and cell d4
if name "a" and "f2" is selected in combo boxes the date is inserted to
worksheet "DM1" and cell e4
if name "b" and "f2" is selected in combo boxes the date is inserted to
worksheet "DM1" and cell e6

and so on

please help this has been tormenting me for weeks or other ideas that could
be simpler if mine is to complex

thanks in advance