Hallo alle zusammen,
Habe folgendes kleines Problem: Ich habe auf einem Arbeitsblatt eine bestimmte Spalte (Währungsformatiert auf Euro) gestellelt.
Jetzt hab ich ein Makro, welches die Positionen in dieses Arbeitsblatt einträgt, jedoch stellt er die Spaltenformatierung auf DM zurück, aber warum - zur Sicherheit mal der Code
Bitte um Hilfe
Großes Dank im Vorraus
Alexander
Sub CWB()
Application.ScreenUpdating = False
Application.Calculation = xlManual
Dim x, y, AZ As Object
Dim gefunden_x As Boolean
Dim gefunden_y As Boolean
gefunden_x = False
gefunden_y = False
Dim Endpreis As Variant
Sheets("Frondorf").Select
Cells.Select
Selection.Copy
Range("A1").Select
Sheets("TabelleFrondorf").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveCell.SpecialCells(xlLastCell).Select
ActiveCell.Offset(1, 0).Activate
ActiveCell.FormulaR1C1 = "x"
Range("J1").Select
Set AZ = ActiveCell
Do
If (AZ = "" Or AZ = "0") Then
If gefunden_x = False Then
Set x = AZ
gefunden_x = True
End If
Else
If gefunden_x = True Then
If gefunden_y = False Then
Set y = AZ
gefunden_y = True
x.Resize(y.Row - x.Row, 1).EntireRow.Delete
gefunden_y = False
gefunden_x = False
End If
End If
End If
If (AZ.Value = "x") Then
Exit Do
End If
Set AZ = AZ.Offset(1)
Loop Until False
AZ.EntireRow.Delete
Cells.Select
Cells.Select
Selection.Columns.AutoFit
Range("A1").Select
Columns("J:J").Select
Selection.Replace What:="1", Replacement:="", LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False
Range("A1").Select
Sheets("Gesamtansicht").Select
Cells.Select
Application.CutCopyMode = False
Selection.ClearContents
Range("A1").Select
Sheets("TabelleFrondorf").Select
Range("A1").Select
Cells.Find(What:="Endpreis", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:= _
xlByRows, SearchDirection:=xlNext, MatchCase:=False). _
Activate
Selection.Resize(, 4).Select
Selection.Copy
Range("A1").Select
Sheets("Gesamtansicht").Select
Range("B1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("TabelleFritz").Select
Range("A1").Select
Cells.Find(What:="Gesamtpreis", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:= _
xlByRows, SearchDirection:=xlNext, MatchCase:=False). _
Activate
Selection.Resize(, 4).Select
Application.CutCopyMode = False
Selection.Copy
Range("A1").Select
Sheets("Gesamtansicht").Select
Range("B3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("TabelleDornhöfer").Select
Range("A1").Select
Cells.Find(What:="Gesamtpreis", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:= _
xlByRows, SearchDirection:=xlNext, MatchCase:=False). _
Activate
Selection.Resize(, 4).Select
Application.CutCopyMode = False
Selection.Copy
Range("A1").Select
Sheets("Gesamtansicht").Select
Range("B5").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("B1").Select
Application.CutCopyMode = False
Selection.Copy
Range("B1:B5").Select
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone _
, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Columns("B:B").EntireColumn.AutoFit
Range("A1").Select
ActiveCell.FormulaR1C1 = "Fa.Frondorf"
Range("A3").Select
ActiveCell.FormulaR1C1 = "Fa.Fritz"
Range("A5").Select
ActiveCell.FormulaR1C1 = "Fa.Dornhöfer"
Range("A1").Select
Columns("A:A").EntireColumn.AutoFit
Application.Calculation = xlAutomatic
Application.ScreenUpdating = True |