Option Explicit
27.11.2003 12:11:06
junny
kann mir jemand ein wenig auf die Sprünge helfen??
Wann muss Option Explicit/
Private Sub rein?? Wie siehst da mit F8 aus?
Ich hab hier ein Makro welches in eienm Sheet steht, ist das in Ordnung? sprich läuft es automatisch ab??
DANKE!! Grüsse volker
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
' alle Buchstaben Groß in einem bestimmten Bereich
Dim RaBereich As Range, RaZelle As Range
Application.EnableEvents = False
' Bereich der Wirksamkeit
Set RaBereich = Range("I5:I319")
Application.EnableEvents = False
For Each RaZelle In Range(Target.Address)
If Not Intersect(RaZelle, RaBereich) Is Nothing Then
RaZelle.Value = UCase(RaZelle.Value)
End If
Next RaZelle
Application.EnableEvents = True
Set RaBereich = Nothing
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim vorigeZelle As Range
Set vorigeZelle = ActiveCell
' automatisches ausfüllen Materialcode Kantengrafik, Gesamtstückzahl
'Serie
Range("U6").Select
ActiveCell.FormulaR1C1 = "=IF((RC[-16])>0,R5C21,"""")"
Selection.AutoFill Destination:=Range("U6:U319"), Type:=xlFillCopy
'Materialcode
Range("W5").Select
ActiveCell.Formula = "=CONCATENATE(I5,H5)"
Selection.AutoFill Destination:=Range("W5:W319"), Type:=xlFillDefault
'Erfassungsnummer
Range("X6").Select
ActiveCell.FormulaR1C1 = "=IF((RC[-19])>0,R5C24,"""")"
Selection.AutoFill Destination:=Range("X6:X319"), Type:=xlFillCopy
'Kantengrafik
Range("AV5").Select
ActiveCell.Formula = "=O5"
Selection.AutoFill Destination:=Range("AV5:AV319"), Type:=xlFillDefault
'Gesamtstückzahl
Range("AW5").Select
ActiveCell.Formula = "=E5"
Selection.AutoFill Destination:=Range("AW5:AW319"), Type:=xlFillDefault
vorigeZelle.Select
End Sub