Hallo Huijb,
Ik heb jouw code gebruikt, hij vraagt dan of de macro moet worden ingeschakeld.
Klik ik op ja dan gebeurd er niets, kijk ik dan naar Extra/Macro, zijn alle macro's weg en er is niet afgesloten.
Als hij met mijn code de fout melding geeft zijn ook de macro's weg en moet ik opnieuw opstarten om ze weer te zien.
Hier onder de code die onder de knop invoer zit, deze is gemaakt door JZEEDIJK
Ik heb in de menubalk een knop gemaakt om de file optestarten.
Private Sub CommandButton1_BeforeDropOrPaste(ByVal Cancel As MSForms.ReturnBoolean, ByVal Action As MSForms.fmAction, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
End Sub
Private Sub CommandButton1_Click()
INR = InputBox("Wat is de INR waarde")
Range("D6") = INR
Datum = Range("O4"): If Date - Datum < 7 Then Range("B8") = "U heeft al een waarde ingevoerd": Exit Sub
Range("B8") = ""
INR = Range("D6"): Stap = Range("M4"): Rij = Worksheets(3).Range("A3")
Maandag = Range("D11"): Dinsdag = Range("E11"): Woensdag = Range("F11")
Donderdag = Range("G11"): Vrijdag = Range("H11"): Zaterdag = Range("I11"): Zondag = Range("J11")
If INR < 2 Then
Range("B8") = "Neem contact op met het lab"
Range("O4") = Date
Worksheets(3).Cells(Rij, 1) = Date
Worksheets(3).Cells(Rij, 2) = INR
Worksheets(3).Range("A3") = Rij + 1
Exit Sub
End If
If INR < 2.3 Then
Stap = Stap + 2
Range("M4") = Stap
Range("N4") = 2
Range("O4") = Date
Worksheets(3).Cells(Rij, 1) = Date
Worksheets(3).Cells(Rij, 2) = INR
Worksheets(3).Cells(Rij, 3) = Stap
For i = 1 To 7: Worksheets(3).Cells(Rij, 3 + i) = Cells(11, 3 + i): Next i
Worksheets(3).Range("A3") = Rij + 1
Exit Sub
End If
If INR < 2.5 Then
Stap = Stap + 1
Range("M4") = Stap
Range("N4") = 1
Range("O4") = Date
Worksheets(3).Cells(Rij, 1) = Date
Worksheets(3).Cells(Rij, 2) = INR
Worksheets(3).Cells(Rij, 3) = Stap
For i = 1 To 7: Worksheets(3).Cells(Rij, 3 + i) = Cells(11, 3 + i): Next i
Worksheets(3).Range("A3") = Rij + 1
Exit Sub
End If
If INR < 3.6 Then
Stap = Stap
Range("M4") = Stap
'Range("N4") = 0
Range("O4") = Date
Worksheets(3).Cells(Rij, 1) = Date
Worksheets(3).Cells(Rij, 2) = INR
Worksheets(3).Cells(Rij, 3) = Stap
For i = 1 To 7: Worksheets(3).Cells(Rij, 3 + i) = Cells(11, 3 + i): Next i
Worksheets(3).Range("A3") = Rij + 1
Exit Sub
End If
If INR < 4 Then
Stap = Stap - 1
Range("M4") = Stap
Range("N4") = -1
Range("O4") = Date
Worksheets(3).Cells(Rij, 1) = Date
Worksheets(3).Cells(Rij, 2) = INR
Worksheets(3).Cells(Rij, 3) = Stap
For i = 1 To 7: Worksheets(3).Cells(Rij, 3 + i) = Cells(11, 3 + i): Next i
Worksheets(3).Range("A3") = Rij + 1
Exit Sub
End If
If INR < 5 Then
Stap = Stap - 2
Range("M4") = Stap
Range("N4") = -2
Range("O4") = Date
Worksheets(3).Cells(Rij, 1) = Date
Worksheets(3).Cells(Rij, 2) = INR
Worksheets(3).Cells(Rij, 3) = Stap
For i = 1 To 7: Worksheets(3).Cells(Rij, 3 + i) = Cells(11, 3 + i): Next i
Worksheets(3).Range("A3") = Rij + 1
Exit Sub
End If
If INR > 5 Then
Range("B8") = "Neem contact op met het lab"
Range("O4") = Date
Worksheets(3).Cells(Rij, 1) = Date
Worksheets(3).Cells(Rij, 2) = INR
Worksheets(3).Range("A3") = Rij + 1
Exit Sub
End If
'Range("B8") = "Neem contact op met het lab": Range("O4") = Date
Exit Sub
End Sub
Private Sub CommandButton1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
End Sub
Private Sub CommandButton1_Error(ByVal Number As Integer, ByVal Description As MSForms.ReturnString, ByVal SCode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, ByVal CancelDisplay As MSForms.ReturnBoolean)
End Sub
Private Sub CommandButton1_GotFocus()
End Sub
Private Sub CommandButton1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
End Sub
Private Sub CommandButton1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
End Sub
Private Sub CommandButton1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
End Sub
Private Sub Worksheet_Activate()
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
End Sub
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
End Sub
Private Sub Worksheet_Calculate()
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
End Sub
Private Sub Worksheet_Deactivate()
End Sub
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
End Sub
Groetjes Hoornvan