Vorab:
Ich Möchte eine Aus mehreren "Blechlisten" (alle in einer Datei) aus Verschiedenen Zeilen die dazugehörigen Informationen in ein neues Arbeitsblatt die dazugehörige "blechkarte" erstellen.
Nun weiß ich aber nicht wie ich das bewerkstelligen kann. Mal funktioniert es, mal geht es nicht.
Momentan habe ich es auf die Mappe BRI eingegrenzt, dies soll aber später in jeder anderen gestartet werden können.
Hier mal mein Code. Es soll halt so angelegt werden das diese Blechkarten auf eine Din A4 Karte passen.
Habe heute solange daran rumg probiert bis gar nichts mehr ging. Nun habe ich aber auch keine Ahnung mehr wie ich es lösen kann.
Ich möchte von 1 bis 3 Blechkarten erstellen diese sollen dann untereinander stehen.
Sub Blechkarte()
Dim intArea As Integer
Dim rngCell As Range
Dim x As Integer
Dim P
r = ActiveCell.Row
If i > 4 Then
ActiveWorkbook.Application.Calculation = xlCalculationManual
For t = 1 To 4
If t = 1 Or t = 3 Then
k = 0
Else
k = 0
End If
If t = 3 Or t = 4 Then
l = 0
Else
l = 0
End If
Worksheets("Blechkarte").Cells(2 + k, 2 + l).Value = ""
Worksheets("Blechkarte").Cells(2 + k, 3 + l).Value = ""
Worksheets("Blechkarte").Cells(2 + k, 1 + l).Value = ""
Worksheets("Blechkarte").Cells(4 + k, 2 + l).Value = ""
Worksheets("Blechkarte").Cells(7 + k, 2 + l).Value = ""
Worksheets("Blechkarte").Cells(8 + k, 3 + l).Value = ""
Worksheets("Blechkarte").Cells(9 + k, 3 + l).Value = P
Next
Worksheets("Blechkarte").Activate
j = 0
For intArea = 1 To Selection.Areas.Count
For Each rngCell In Selection.Areas(intArea).Cells
j = j
x = rngCell.Row
If j = 1 Then a = x
If j = 2 Then b = x
If j = 3 Then c = x
If j = 4 Then d = x
Next
Next
For i = 1 To 4
If i = 1 Then y = a
If i = 2 Then y = b
If i = 3 Then y = c
If i = 4 Then y = d
If y = "" Then GoTo sprung
If i = 1 Or i = 4 Then
k = 0
Else
k = 0
End If
If i = 3 Or i = 4 Then
l = 0
Else
l = 0
End If
Worksheets("Blechkarte").Cells(2 + k, 2).Value = Worksheets("BRI").Cells(y, 7) 'Material
Worksheets("Blechkarte").Cells(1 + k, 1).Value = Worksheets("BRI").Cells(y, 8) 'Struktur
Worksheets("Blechkarte").Cells(4 + k, 2).Value = Worksheets("BRI").Cells(y, 19) 'Hersteller
Worksheets("Blechkarte").Cells(6 + k, 2).Value = Worksheets("BRI").Cells(y, 13) 'Dekor
Worksheets("Blechkarte").Cells(1 + k, 6).Value = Worksheets("BRI").Cells(y, 2) 'EEQ
Worksheets("Blechkarte").Cells(3 + k, 6).Value = Worksheets("BRI").Cells(y, 2) 'EEQ Barcode
Worksheets("Blechkarte").Cells(10 + k, 10 + l).Value = P 'Char
Next
End If
sprung:
ActiveWorkbook.Application.Calculation = xlCalculationAutomatic
Worksheets("Blechkarte").PrintPreview
End Sub
Private Sub x()
Dim intArea As Integer
Dim rngCell As Range
For intArea = 1 To Selection.Areas.Count
For Each rngCell In Selection.Areas(intArea).Cells
Debug.Print rngCell.Row
Next
Next
End Sub