Sub NeuGestaltung()
Call EventsOff
Dim suche As Range
Dim zaehler As Long
Dim zaehler1 As Long
zaehler1 = 1
With Workbooks(1).Worksheets(1)
For zaehler = 2 To .Range("A" & Rows.Count).End(xlUp).Row
Set suche = Workbooks(1).Worksheets(2).Range("A2" & ":A" & Workbooks(1).Worksheets(2).UsedRange.SpecialCells(xlCellTypeLastCell).Row).Find(.Range("A" & zaehler))
If Not suche Is Nothing Then
Workbooks(1).Worksheets(2).Cells(suche.Row, Workbooks(1).Worksheets(2).Range(suche.Row & ":" & suche.Row).End(xlToRight).Column + 1) = .Range("B" & zaehler)
Workbooks(1).Worksheets(2).Cells(suche.Row, Workbooks(1).Worksheets(2).Range(suche.Row & ":" & suche.Row).End(xlToRight).Column + 1) = .Range("C" & zaehler)
zaehler1 = suche.Row
Else
.Rows(zaehler & ":" & zaehler).Copy Workbooks(1).Worksheets(2).Range("A" & Workbooks(1).Worksheets(2).Range("A" & Rows.Count).End(xlUp).Row + 1)
End If
Next zaehler
End With
Call EventsOn
End SubPublic Sub EventsOff()
With Application
.DisplayAlerts = False
.ScreenUpdating = False
.EnableEvents = False
.Calculation = xlCalculationManual
End With
End SubPublic Sub EventsOn()
With Application
.DisplayAlerts = True
.ScreenUpdating = True
.EnableEvents = True
.Calculation = xlCalculationAutomatic
End With
End SubSub NeuGestaltung()
Call EventsOff
Dim suche As Range
Dim zaehler As Long
With Workbooks(1).Worksheets(1)
For zaehler = 2 To .Range("A" & Rows.Count).End(xlUp).Row
Set suche = Workbooks(1).Worksheets(2).Range("A2" & ":A" & Workbooks(1).Worksheets(2).UsedRange.SpecialCells(xlCellTypeLastCell).Row).Find(.Range("A" & zaehler))
If Not suche Is Nothing Then
Workbooks(1).Worksheets(2).Cells(suche.Row, Workbooks(1).Worksheets(2).Range(suche.Row & ":" & suche.Row).End(xlToRight).Column + 1) = .Range("B" & zaehler)
Workbooks(1).Worksheets(2).Cells(suche.Row, Workbooks(1).Worksheets(2).Range(suche.Row & ":" & suche.Row).End(xlToRight).Column + 1) = .Range("C" & zaehler)
Else
.Rows(zaehler & ":" & zaehler).Copy Workbooks(1).Worksheets(2).Range("A" & Workbooks(1).Worksheets(2).Range("A" & Rows.Count).End(xlUp).Row + 1)
End If
Next zaehler
End With
Call EventsOn
End Sub
Public Sub EventsOff()
With Application
.DisplayAlerts = False
.ScreenUpdating = False
.EnableEvents = False
.Calculation = xlCalculationManual
End With
End Sub
Public Sub EventsOn()
With Application
.DisplayAlerts = True
.ScreenUpdating = True
.EnableEvents = True
.Calculation = xlCalculationAutomatic
End With
End SubSub NeuGestaltung()
Call EventsOff
Dim suche As Range
Dim zaehler As Long
With Workbooks(1).Worksheets(1)
For zaehler = 2 To .Range("A" & Rows.Count).End(xlUp).Row
Set suche = Workbooks(1).Worksheets(2).Range("A2" & ":A" & Workbooks(1).Worksheets(2).UsedRange.SpecialCells(xlCellTypeLastCell).Row).Find(.Range("A" & zaehler))
If Not suche Is Nothing Then
Workbooks(1).Worksheets(2).Cells(suche.Row, Workbooks(1).Worksheets(2).Range(suche.Row & ":" & suche.Row).End(xlToRight).Column + 1) = .Range("B" & zaehler)
Workbooks(1).Worksheets(2).Cells(suche.Row, Workbooks(1).Worksheets(2).Range(suche.Row & ":" & suche.Row).End(xlToRight).Column + 1) = .Range("C" & zaehler)
Else
.Rows(zaehler & ":" & zaehler).Copy Workbooks(1).Worksheets(2).Range("A" & Workbooks(1).Worksheets(2).Range("A" & Rows.Count).End(xlUp).Row + 1)
End If
Next zaehler
End With
Workbooks(1).Worksheets(2).Range(Workbooks(1).Worksheets(2).Cells(2, 1), Workbooks(1).Worksheets(2).Cells(Workbooks(1).Worksheets(2).UsedRange.SpecialCells(xlCellTypeLastCell).Row, Workbooks(1).Worksheets(2).UsedRange.SpecialCells(xlCellTypeLastCell).Column)).Replace what:="", replacement:="' '", searchorder:=xlByColumns, MatchCase:=True
Call EventsOn
End Sub
Public Sub EventsOff()
With Application
.DisplayAlerts = False
.ScreenUpdating = False
.EnableEvents = False
.Calculation = xlCalculationManual
End With
End Sub
Public Sub EventsOn()
With Application
.DisplayAlerts = True
.ScreenUpdating = True
.EnableEvents = True
.Calculation = xlCalculationAutomatic
End With
End Sub
Transponieren kompleser Spalten
ikos 18.01.2007 - 115 Hits -
Access Kombifeld Aktualisierung
Samuel_K 31.01.2007 - 89 Hits - 2 Antworten
SQL: Lagerbestand ermitteln mehrere Lagerorte
Elhamplo 09.08.2007 - 192 Hits - 3 Antworten
wie ergänze ich eine Tabelle aus Daten einer anderen Tabelle, wenn ein Suchkriterium übereinstimmt?
kromgi 15.11.2007 - 76 Hits - 8 Antworten
Desktop-Icons unter Xubuntu frei anordnen
REMARA 05.02.2008 - 40 Hits - 7 Antworten