its my first message in here. I am from austria and work in switzerland as a detail planner. We created a tool in excel where we can count the pieces in production and we see which failures we have and how much time we loose. At the end the calculation will give us an oee. Its the cheap version if you dont want to buy a running system for that
Now i have a question for a code in vba, we created a userform to definite which failure we have.
Our sensor writes always a 1 the machine produces. if not there is nothing. For example, we dont produce 30min, after that we start producing and the sensor write 1. Then the userform pop up and want that we say, why we could not produce the last 30min.
First there was a combobox with a list - but now we decided to change that in a normal textbox and scan a barcode, so the reason will be in the textorm.
So far so good - that works, and the reason will also be in the excel then.
BUT: at the next time when the userform open the textform is allready filled with this reason code - but i want that it is always empty, when it opens.
I am sure, there will be a very simple solution, but i cant find it
This is the code of the userform:
Private mobjCell As Range
Private Sub CommandButton1_Click()
Private Sub CommandButton2_Click()
If TextBox1 <> "" Then
Cell.Value = TextBox1.Text
Call MsgBox("Bitte erst eine Begründung eingeben.", vbExclamation, "Hinweis")
Private Sub Label1_Click()
Private Sub UserForm_Initialize()
TextBox1.Text = ""
Private Sub UserForm_Terminate()
Set Cell = Nothing
Public Property Get Cell() As Range
Set Cell = mobjCell
Public Property Set Cell(ByRef probjCell As Range)
Set mobjCell = probjCell
I hope you someone can help me - i am not sure if this must be in the code of the userform or in the worksheet code?!
Thank you all and br