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

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
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


--
Regards,
Tom Ogilvy



"Stift " wrote in message
...
No sorry but that is not what I mean.Weeknummers are asked in a other
form.

In language it has to be something like this:

If the cell where the cell-values are stored in combobox1 has a red
background then
remove the cell from the list (that works now) and say to textbox 1
that he musn't refer to the next cell but one further.

Please I need this fixed to finish my trainee-project!


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