Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim myArr As Variant
- Dim myRow1 As Long
- Dim myRow2 As Long
- Dim myCol2 As Long
- Dim eqNo As Long
- Dim Destination As Range
- myRow1 = 1
- myRow2 = 1
- myCol2 = 2
- eqNo = 10000000
- myArr = Array(Sheets("MAT-EQ KUT").Range("C5:J1594").Value)
- Sheets("Tabelle1").Activate
- Set Destination = Array(Sheets("Tabelle1").Range("A1").Resize(1801, 1590).Value) = myArr
- ActiveSheet.Unprotect
- With Sheets("Tabelle1")
- For myRow2 = 1 To 1801
- myCol2 = 2
- Sheets("Tabelle1").Cells(myRow2, 1) = eqNo
- For myRow1 = 1 To 1590
- If myArr(myRow1, 2) = eqNo Then
- Sheets("Tabelle1").Cells(myRow2, myCol2) = myArr(myRow1, 1)
- ElseIf myArr(myRow1, 3) = eqNo Then
- Sheets("Tabelle1").Cells(myRow2, myCol2 + 1) = myArr(myRow1, 1)
- ElseIf myArr(myRow1, 4) = eqNo Then
- Sheets("Tabelle1").Cells(myRow2, myCol2 + 2) = myArr(myRow1, 1)
- ElseIf myArr(myRow1, 5) = eqNo Then
- Sheets("Tabelle1").Cells(myRow2, myCol2 + 3) = myArr(myRow1, 1)
- ElseIf myArr(myRow1, 6) = eqNo Then
- Sheets("Tabelle1").Cells(myRow2, myCol2 + 4) = myArr(myRow1, 1)
- ElseIf myArr(myRow1, 7) = eqNo Then
- Sheets("Tabelle1").Cells(myRow2, myCol2 + 5) = myArr(myRow1, 1)
- ElseIf myArr(myRow1, 8) = eqNo Then
- Sheets("Tabelle1").Cells(myRow2, myCol2 + 6) = myArr(myRow1, 1)
- End If
- myCol2 = myCol2 + 7
- Next myRow1
- eqNo = eqNo + 1
- Next myRow2
- End With
- ActiveSheet.Protect
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement