Hallo,
Ik gebruik een macro om te controleren of bepaalde velden zijn ingevuld. nu wil ik deze vereenvoudigen.
Dit werkt niet, hoe krijg ik hem wel werkend
Ik gebruik een macro om te controleren of bepaalde velden zijn ingevuld. nu wil ik deze vereenvoudigen.
Code:
With Sheets("Kappenbril")
If .Range("M203") = "Autograph_III_1.5" Then
CheckKappenbril = LegeCel("AI218", "Kappenbril")
CheckKappenbril = LegeCel("AI219", "Kappenbril")
CheckKappenbril = LegeCel("AI220", "Kappenbril")
CheckKappenbril = LegeCel("J214", "Kappenbril")
End If
End With
With Sheets("Kappenbril")
If .Range("M203") = "Autograph_III_1.6" Then
CheckKappenbril = LegeCel("AI218", "Kappenbril")
CheckKappenbril = LegeCel("AI219", "Kappenbril")
CheckKappenbril = LegeCel("AI220", "Kappenbril")
CheckKappenbril = LegeCel("J214", "Kappenbril")
End If
End With
With Sheets("Kappenbril")
If .Range("M203") = "Autograph_III_1.67" Then
CheckKappenbril = LegeCel("AI218", "Kappenbril")
CheckKappenbril = LegeCel("AI219", "Kappenbril")
CheckKappenbril = LegeCel("AI220", "Kappenbril")
CheckKappenbril = LegeCel("J214", "Kappenbril")
End If
End With
With Sheets("Kappenbril")
If .Range("M203") = "Autograph_III_1.74" Then
CheckKappenbril = LegeCel("AI218", "Kappenbril")
CheckKappenbril = LegeCel("AI219", "Kappenbril")
CheckKappenbril = LegeCel("AI220", "Kappenbril")
CheckKappenbril = LegeCel("J214", "Kappenbril")
End If
End With
Dit werkt niet, hoe krijg ik hem wel werkend
Code:
If .Range("M203") = "Autograph_III_1.5", If .Range("M203") = "Autograph_III_1.6", If .Range("M203") = "Autograph_III_1.67", If .Range("M203") = "Autograph_III_1.74" Then
CheckKappenbril = LegeCel("AI218", "Kappenbril")
CheckKappenbril = LegeCel("AI219", "Kappenbril")
CheckKappenbril = LegeCel("AI220", "Kappenbril")
CheckKappenbril = LegeCel("J214", "Kappenbril")
End If
End With