View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Textbox focus lost

There was a missing End if


this compiles OK

Private Sub CommandButton1_Click()
If Me.TextBox1.Text = "" Then
MsgBox "Vul getal in"
Else
X = Me.ComboBox1.ListIndex
Me.ComboBox1.ListIndex = IIf(X = 160, 0, X + 1)

If Weekscherm.ComboBox1.Value = "Week 1" Then
Set ListRange = _
ActiveSheet.Range("C9:C106,C113:C162,C169:C183")
kk = 0
For Each Cell In ListRange.Cells
If Cell.Interior.ColorIndex < 3 Then
kk = kk + 1
If kk = ComboBox1.ListIndex + 1 Then
idex = Cell.Row
Exit For
End If
End If
Next Cell
Set Cel = Cells(idex, 17)
Cel.Value = Me.TextBox1.Text
End If
'.....so a if for every week of the year'

Me.TextBox1.Text = ""
ComboBox1.AutoTab = True
End If

End Sub

--
Regards,
Tom Ogilvy

"Stift " wrote in message
...
Please somebody help me !!! I really must get this working!


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