Consulting

Results 1 to 4 of 4

Thread: Help for make small VBA code

  1. #1
    VBAX Newbie
    Joined
    Oct 2022
    Posts
    2
    Location

    Help for make small VBA code

    Hi. can somebody help me to make smaller my VBA code? Thanks.


    Private Sub CheckBox1_Change()
     If CheckBox1.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D3") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E3")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
       End If
       Worksheets("HELP").Visible = False
       End Sub
     
    Private Sub CheckBox2_Change()
     If CheckBox2.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D4") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E4")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox3_Change()
     If CheckBox3.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D5") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E5")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
    Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox4_Change()
     If CheckBox4.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D6") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E6")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
      
     Private Sub CheckBox5_Change()
     If CheckBox5.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D7") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E7")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox6_Change()
    If CheckBox6.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D8") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E8")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox7_Change()
    If CheckBox7.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D9") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E9")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox8_Change()
    If CheckBox8.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D10") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E10")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox9_Change()
    If CheckBox9.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D11") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E11")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox10_Change()
    If CheckBox10.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D12") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E12")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox11_Change()
    If CheckBox11.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D13") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E13")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox12_Change()
    If CheckBox12.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D14") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E14")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox13_Change()
    If CheckBox13.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D15") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E15")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox14_Change()
    If CheckBox14.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D16") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E16")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox15_Change()
    If CheckBox15.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D17") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E17")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox16_Change()
    If CheckBox16.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D18") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E18")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox17_Change()
    If CheckBox17.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D19") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E19")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox18_Change()
    If CheckBox18.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D20") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E20")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox19_Change()
    If CheckBox19.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D21") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E21")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox20_Change()
    If CheckBox20.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D22") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E22")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
    Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox21_Change()
    If CheckBox21.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D23") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E23")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox22_Change()
    If CheckBox22.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D24") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E24")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox23_Change()
    If CheckBox23.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D25") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E25")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox24_Change()
    If CheckBox24.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D26") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E26")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox25_Change()
    If CheckBox25.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D27") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E27")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox26_Change()
    If CheckBox26.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D28") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E28")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox27_Change()
    If CheckBox27.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D29") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E29")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
     End Sub
     
    Private Sub CheckBox28_Change()
    If CheckBox28.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D30") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E30")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox29_Change()
    If CheckBox29.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D31") & vbNewLine & " " & "WAP:" & "  " & _ 
       Worksheets("Frue Verladung").Range("E31")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox30_Change()
    If CheckBox30.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D32") & vbNewLine & " " & "WAP:" & "  " & _
        Worksheets("Frue Verladung").Range("E32")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox31_Change()
    If CheckBox31.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D33") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E33")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox32_Change()
    If CheckBox32.Value = True Then
        Dim Msg As String
        Msg = Msg & Worksheets("Frue Verladung").Range("D34") & vbNewLine & " " & "WAP:" & "  " & _
        Worksheets("Frue Verladung").Range("E34")
        Sheets("HELP").Range("D3") = Msg
        Worksheets("HELP").Visible = True
        ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
        End If
        Worksheets("HELP").Visible = False
        End Sub
     
    Private Sub CheckBox33_Change()
    If CheckBox33.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D35") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E35")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
    Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox34_Change()
    If CheckBox34.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D36") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E36")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox35_Change()
    If CheckBox35.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D37") & vbNewLine & " " & "WAP:" & "  " & _ 
       Worksheets("Frue Verladung").Range("E37")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
       ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox36_Change()
    If CheckBox36.Value = True Then
     Dim Msg As String
     Msg = Msg & Worksheets("Frue Verladung").Range("D38") & vbNewLine & " " & "WAP:" & "  " & _ Worksheets("Frue Verladung").Range("E38")
    Sheets("HELP").Range("D3") = Msg
      Worksheets("HELP").Visible = True
    ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
     
    Private Sub CheckBox37_Change()
    If CheckBox37.Value = True Then
     Dim Msg As String
     Msg = Msg & Worksheets("Frue Verladung").Range("D39") & vbNewLine & " " & "WAP:" & "  " & _ Worksheets("Frue Verladung").Range("E39")
    Sheets("HELP").Range("D3") = Msg
      Worksheets("HELP").Visible = True
    ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
     Worksheets("HELP").Visible = False
      End Sub
      
     Private Sub CheckBox38_Change()
    If CheckBox38.Value = True Then
       Dim Msg As String
       Msg = Msg & Worksheets("Frue Verladung").Range("D40") & vbNewLine & " " & "WAP:" & "  " & _
       Worksheets("Frue Verladung").Range("E40")
       Sheets("HELP").Range("D3") = Msg
       Worksheets("HELP").Visible = True
        ActiveWorkbook.Worksheets("HELP").PrintOut copies:=1, Collate:=True
    End If
      Worksheets("HELP").Visible = False
    End Sub
    
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Worksheets("Frue Verladung").Range("O3").Value = "Fertig" And _
    Len(Worksheets("Frue Verladung").Range("d3").Value) > 2 Then
       CheckBox1.Visible = True
       CheckBox1.Enabled = True
    Else
       CheckBox1.Visible = False
       CheckBox1.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O4").Value = "Fertig" And _ 
    Len(Worksheets("Frue        Verladung").Range("d4").Value) > 2 Then
       CheckBox2.Visible = True
       CheckBox2.Enabled = True
    Else
       CheckBox2.Visible = False
       CheckBox2.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O5").Value = "Fertig" And _
    Len(Worksheets("Frue Verladung").Range("d5").Value) > 2 Then
       CheckBox3.Visible = True
       CheckBox3.Enabled = True
    Else
       CheckBox3.Visible = False
       CheckBox3.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O6").Value = "Fertig" And _
    Len(Worksheets("Frue Verladung").Range("d6").Value) > 2 Then
       CheckBox4.Visible = True
       CheckBox4.Enabled = True
    Else
       CheckBox4.Visible = False
       CheckBox4.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O7").Value = "Fertig" And _
    Len(Worksheets("Frue Verladung").Range("d7").Value) > 2 Then
       CheckBox5.Visible = True
       CheckBox5.Enabled = True
    Else
       CheckBox5.Visible = False
       CheckBox5.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O8").Value = "Fertig" And _
    Len(Worksheets("Frue Verladung").Range("d8").Value) > 2 Then
       CheckBox6.Visible = True
       CheckBox6.Enabled = True
    Else
       CheckBox6.Visible = False
       CheckBox6.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O9").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d9").Value) > 2 Then
       CheckBox7.Visible = True
       CheckBox7.Enabled = True
    Else
       CheckBox7.Visible = False
       CheckBox7.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O10").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d10").Value) > 2 Then
       CheckBox8.Visible = True
       CheckBox8.Enabled = True
    Else
       CheckBox8.Visible = False
       CheckBox8.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O11").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d11").Value) > 2 Then
       CheckBox9.Visible = True
       CheckBox9.Enabled = True
    Else
       CheckBox9.Visible = False
       CheckBox9.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O12").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d12").Value) > 2 Then
       CheckBox10.Visible = True
       CheckBox10.Enabled = True
    Else
       CheckBox10.Visible = False
       CheckBox10.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O13").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d13").Value) > 2 Then
       CheckBox11.Visible = True
       CheckBox11.Enabled = True
    Else
       CheckBox11.Visible = False
       CheckBox11.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O14").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d14").Value) > 2 Then
       CheckBox12.Visible = True
       CheckBox12.Enabled = True
    Else
       CheckBox12.Visible = False
       CheckBox12.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O15").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d15").Value) > 2 Then
       CheckBox13.Visible = True
       CheckBox13.Enabled = True
    Else
       CheckBox13.Visible = False
       CheckBox13.Enabled = False
    End If
    
    
    If Worksheets("Frue Verladung").Range("O16").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d16").Value) > 2 Then
       CheckBox14.Visible = True
       CheckBox14.Enabled = True
    Else
       CheckBox14.Visible = False
       CheckBox14.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O17").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d17").Value) > 2 Then
       CheckBox15.Visible = True
       CheckBox15.Enabled = True
    Else
       CheckBox15.Visible = False
       CheckBox15.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O18").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d18").Value) > 2 Then
       CheckBox16.Visible = True
       CheckBox16.Enabled = True
    Else
       CheckBox16.Visible = False
       CheckBox16.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O19").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d19").Value) > 2 Then
       CheckBox17.Visible = True
       CheckBox17.Enabled = True
    Else
       CheckBox17.Visible = False
       CheckBox17.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O20").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d20").Value) > 2 Then
       CheckBox18.Visible = True
       CheckBox18.Enabled = True
    Else
       CheckBox18.Visible = False
       CheckBox18.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O21").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d21").Value) > 2 Then
       CheckBox19.Visible = True
       CheckBox19.Enabled = True
    Else
       CheckBox19.Visible = False
       CheckBox19.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O22").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d22").Value) > 2 Then
       CheckBox20.Visible = True
       CheckBox20.Enabled = True
    Else
       CheckBox20.Visible = False
       CheckBox20.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O23").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d23").Value) > 2 Then
       CheckBox21.Visible = True
       CheckBox21.Enabled = True
    Else
       CheckBox21.Visible = False
       CheckBox21.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O24").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d24").Value) > 2 Then
       CheckBox22.Visible = True
       CheckBox22.Enabled = True
    Else
       CheckBox22.Visible = False
       CheckBox22.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O25").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d25").Value) > 2 Then
       CheckBox23.Visible = True
       CheckBox23.Enabled = True
    Else
       CheckBox23.Visible = False
       CheckBox23.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O26").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d26").Value) > 2 Then
       CheckBox24.Visible = True
       CheckBox24.Enabled = True
    Else
       CheckBox24.Visible = False
       CheckBox24.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O27").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d27").Value) > 2 Then
       CheckBox25.Visible = True
       CheckBox25.Enabled = True
    Else
       CheckBox25.Visible = False
       CheckBox25.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O28").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d28").Value) > 2 Then
       CheckBox26.Visible = True
       CheckBox26.Enabled = True
    Else
       CheckBox26.Visible = False
       CheckBox26.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O29").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d29").Value) > 2 Then
       CheckBox27.Visible = True
       CheckBox27.Enabled = True
    Else
       CheckBox27.Visible = False
       CheckBox27.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O30").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d30").Value) > 2 Then
       CheckBox28.Visible = True
       CheckBox28.Enabled = True
    Else
       CheckBox28.Visible = False
       CheckBox28.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O31").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d31").Value) > 2 Then
       CheckBox29.Visible = True
       CheckBox29.Enabled = True
    Else
       CheckBox29.Visible = False
       CheckBox29.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O32").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d32").Value) > 2 Then
       CheckBox30.Visible = True
       CheckBox30.Enabled = True
    Else
       CheckBox30.Visible = False
       CheckBox30.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O33").Value = "Fertig" And_
     Len(Worksheets("Frue Verladung").Range("d33").Value) > 2 Then
       CheckBox31.Visible = True
       CheckBox31.Enabled = True
    Else
       CheckBox31.Visible = False
       CheckBox31.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O34").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d34").Value) > 2 Then
       CheckBox32.Visible = True
       CheckBox32.Enabled = True
    Else
       CheckBox32.Visible = False
       CheckBox32.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O35").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d35").Value) > 2 Then
       CheckBox33.Visible = True
       CheckBox33.Enabled = True
    Else
       CheckBox33.Visible = False
       CheckBox33.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O36").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d36").Value) > 2 Then
       CheckBox34.Visible = True
       CheckBox34.Enabled = True
    Else
       CheckBox34.Visible = False
       CheckBox34.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O37").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d37").Value) > 2 Then
       CheckBox35.Visible = True
       CheckBox35.Enabled = True
    Else
       CheckBox35.Visible = False
       CheckBox35.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O38").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d38").Value) > 2 Then
       CheckBox36.Visible = True
       CheckBox36.Enabled = True
    Else
       CheckBox36.Visible = False
       CheckBox36.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O39").Value = "Fertig" And _
     Len(Worksheets("Frue Verladung").Range("d39").Value) > 2 Then
       CheckBox37.Visible = True
       CheckBox37.Enabled = True
    Else
       CheckBox37.Visible = False
       CheckBox37.Enabled = False
    End If
    If Worksheets("Frue Verladung").Range("O40").Value = "Fertig" And
     Len(Worksheets("Frue Verladung").Range("d40").Value) > 2 Then
       CheckBox38.Visible = True
       CheckBox38.Enabled = True
    Else
       CheckBox38.Visible = False
       CheckBox38.Enabled = False
    End If
    End Sub
    Verladung Blanko_2.xlsm
    Last edited by Aussiebear; 10-02-2022 at 07:54 PM. Reason: Added code tags and tidied up submission

  2. #2
    you can try this.
    Attached Files Attached Files

  3. #3
    VBAX Newbie
    Joined
    Oct 2022
    Posts
    2
    Location
    SUPER work perfect. Thanks

  4. #4
    VBAX Regular
    Joined
    Nov 2020
    Location
    Swansea,South Wales,UK
    Posts
    45
    Location
    Might want to review a few of thse videos?
    https://www.youtube.com/results?sear...rogramming+vba

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •