AW: VDA Makro und Formatierung
31.05.2019 20:18:56
Marco
Grüße dich,
Hab mal jetzt alles zusammengebaut, aber es funktioniert leider nicht.
es kommt gleich eine Fehlermeldung.
hier der link mit dem Makro: https://www.herber.de/bbs/user/130135.xlsm
was hab ich falsch gemacht ?
hier der code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address "$B$3" Then Exit Sub
Select Case Target.Value
Case Is = "ACHR"
With Sheets("WKZ.-Pflichtenheft")
.Range("O90:AD98").ClearContents
.Cells(95, 19).Value = "X" ' Zelle S95 = 95. Zeile, 19. Spalte
.Cells(95, 23).Value = "48±²" ' Zelle S95 = 95. Zeile, 23. Spalte
.Cells(98, 19).Value = "X"
.Cells(98, 23).Value = "48±²"
.Cells(99, 19).Value = "X"
.Cells(99, 23).Value = "48±²"
.Cells(100, 19).Value = "X"
.Cells(100, 23).Value = "48±²"
.Shapes("Check Box 145").ControlFormat.Value = xlOn
.Shapes("Check Box 142").ControlFormat.Value = xlOn
' für jedes Kontrollkästchen wiederholen, das aktiviert werden soll
End With
Case Is = "AMTZ"
With Sheets("WKZ.-Pflichtenheft")
.Range("O90:AD98").ClearContents
.Cells(95, 19).Value = "X" ' Zelle S95 = 95. Zeile, 19. Spalte
.Cells(95, 23).Value = "48±²" ' Zelle S95 = 95. Zeile, 23. Spalte
.Cells(98, 19).Value = "X"
.Cells(98, 23).Value = "48±²"
.Cells(99, 19).Value = "X"
.Cells(99, 23).Value = "48±²"
.Cells(100, 19).Value = "X"
.Cells(100, 23).Value = "48±²"
.Shapes("Check Box 145").ControlFormat.Value = xlOn
.Shapes("Check Box 142").ControlFormat.Value = xlOn
' für jedes Kontrollkästchen wiederholen, das aktiviert werden soll
End With
Case Is = "APNT"
.Range("O90:AD98").ClearContents
.Cells(95, 19).Value = "X" ' Zelle S95 = 95. Zeile, 19. Spalte
.Cells(95, 23).Value = "48±²" ' Zelle S95 = 95. Zeile, 23. Spalte
.Cells(98, 19).Value = "X"
.Cells(98, 23).Value = "48±²"
.Cells(99, 19).Value = "X"
.Cells(99, 23).Value = "48±²"
.Cells(100, 19).Value = "X"
.Cells(100, 23).Value = "48±²"
.Shapes("Check Box 145").ControlFormat.Value = xlOn
.Shapes("Check Box 142").ControlFormat.Value = xlOn
' für jedes Kontrollkästchen wiederholen, das aktiviert werden soll
End With
Case Is = "AVIS"
.Range("O90:AD98").ClearContents
.Cells(95, 19).Value = "X" ' Zelle S95 = 95. Zeile, 19. Spalte
.Cells(95, 23).Value = "48±²" ' Zelle S95 = 95. Zeile, 23. Spalte
.Cells(98, 19).Value = "X"
.Cells(98, 23).Value = "48±²"
.Cells(99, 19).Value = "X"
.Cells(99, 23).Value = "48±²"
.Cells(100, 19).Value = "X"
.Cells(100, 23).Value = "48±²"
.Shapes("Check Box 145").ControlFormat.Value = xlOn
.Shapes("Check Box 142").ControlFormat.Value = xlOn
' für jedes Kontrollkästchen wiederholen, das aktiviert werden soll
End With
Case Is = "OTHN"
.Range("O90:AD98").ClearContents
.Cells(95, 19).Value = "X" ' Zelle S95 = 95. Zeile, 19. Spalte
.Cells(95, 23).Value = "48±²" ' Zelle S95 = 95. Zeile, 23. Spalte
.Cells(98, 19).Value = "X"
.Cells(98, 23).Value = "48±²"
.Cells(99, 19).Value = "X"
.Cells(99, 23).Value = "48±²"
.Cells(100, 19).Value = "X"
.Cells(100, 23).Value = "48±²"
.Shapes("Check Box 145").ControlFormat.Value = xlOn
.Shapes("Check Box 142").ControlFormat.Value = xlOn
' für jedes Kontrollkästchen wiederholen, das aktiviert werden soll
End With
Case Is = "OTHK"
.Range("O90:AD98").ClearContents
.Cells(95, 19).Value = "X" ' Zelle S95 = 95. Zeile, 19. Spalte
.Cells(95, 23).Value = "48±²" ' Zelle S95 = 95. Zeile, 23. Spalte
.Cells(98, 19).Value = "X"
.Cells(98, 23).Value = "48±²"
.Cells(99, 19).Value = "X"
.Cells(99, 23).Value = "48±²"
.Cells(100, 19).Value = "X"
.Cells(100, 23).Value = "48±²"
.Shapes("Check Box 145").ControlFormat.Value = xlOn
.Shapes("Check Box 142").ControlFormat.Value = xlOn
' für jedes Kontrollkästchen wiederholen, das aktiviert werden soll
End With
Case Is = "OLIG"
.Range("O90:AD98").ClearContents
.Cells(95, 19).Value = "X" ' Zelle S95 = 95. Zeile, 19. Spalte
.Cells(95, 23).Value = "48±²" ' Zelle S95 = 95. Zeile, 23. Spalte
.Cells(98, 19).Value = "X"
.Cells(98, 23).Value = "48±²"
.Cells(99, 19).Value = "X"
.Cells(99, 23).Value = "48±²"
.Cells(100, 19).Value = "X"
.Cells(100, 23).Value = "48±²"
.Shapes("Check Box 145").ControlFormat.Value = xlOn
.Shapes("Check Box 142").ControlFormat.Value = xlOn
' für jedes Kontrollkästchen wiederholen, das aktiviert werden soll
End With
' Case Else
' With Sheets("WKZ.-Pflichtenheft")
' .Range("O90:AD98").ClearContents
'.Shapes("Check Box 145").ControlFormat.Value = xlOff
'.Shapes("Check Box 142").ControlFormat.Value = xlOff
'... für jedes Kontrollkästchen!!!
' End With
End Select
End Sub
liebe Grüße
Marco