Hello,
you mean that i put the activate code instead of initialize? dont works - maybe the code dont compare with the other code in worksheets.
Code
ActiveSheet.Protect userinterfaceonly:=False
Dim objCell As Range
For Each objCell In Range(Cells(3, 18), Cells(Rows.Count, 18).End(xlUp))
If objCell.Value >= TimeSerial(0, 0, 10) Then
If IsEmpty(objCell.Offset(0, 1).Value) Then
With UserForm1
Set .Cell = objCell.Offset(0, 1)
If Not .Visible Then Call .Show
Call AppActivate(Application.Caption)
Exit For
End With
End If
End If
Next
End Sub
Display More
Thats the code of the userform:
Code
Option Explicit
Private mobjCell As Range
Private Sub CommandButton1_Click()
Call Hide
End Sub
Private Sub CommandButton2_Click()
If TextBox1 <> "" Then
Cell.Value = TextBox1.Text
Else
Call MsgBox("Bitte erst eine Begründung eingeben.", vbExclamation, "Hinweis")
End If
Call Hide
End Sub
Private Sub Label1_Click()
End Sub
Private Sub UserForm_Activate()
Me.Tag = Val(Me.Tag) + 1
CommandButton1.Caption = "Hide (" & CStr(Me.Tag) & ")"
With TextBox1
.Text = ""
.SetFocus
End With
End Sub
Private Sub UserForm_Terminate()
Set Cell = Nothing
End Sub
Public Property Get Cell() As Range
Set Cell = mobjCell
End Property
Public Property Set Cell(ByRef probjCell As Range)
Set mobjCell = probjCell
End Property
Display More