Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. Dim myArr As Variant
  2. Dim myRow1 As Long
  3. Dim myRow2 As Long
  4.  
  5. Dim myCol2 As Long
  6.  
  7. Dim eqNo As Long
  8.  
  9. Dim Destination As Range
  10.  
  11. myRow1 = 1
  12.  
  13. myRow2 = 1
  14.  
  15. myCol2 = 2
  16.  
  17. eqNo = 10000000
  18. myArr = Array(Sheets("MAT-EQ KUT").Range("C5:J1594").Value)
  19. Sheets("Tabelle1").Activate
  20. Set Destination = Array(Sheets("Tabelle1").Range("A1").Resize(1801, 1590).Value) = myArr
  21. ActiveSheet.Unprotect
  22. With Sheets("Tabelle1")
  23.  
  24. For myRow2 = 1 To 1801
  25. myCol2 = 2
  26.  
  27. Sheets("Tabelle1").Cells(myRow2, 1) = eqNo
  28.  
  29. For myRow1 = 1 To 1590
  30.  
  31. If myArr(myRow1, 2) = eqNo Then
  32. Sheets("Tabelle1").Cells(myRow2, myCol2) = myArr(myRow1, 1)
  33.  
  34. ElseIf myArr(myRow1, 3) = eqNo Then
  35. Sheets("Tabelle1").Cells(myRow2, myCol2 + 1) = myArr(myRow1, 1)
  36.  
  37. ElseIf myArr(myRow1, 4) = eqNo Then
  38. Sheets("Tabelle1").Cells(myRow2, myCol2 + 2) = myArr(myRow1, 1)
  39.  
  40. ElseIf myArr(myRow1, 5) = eqNo Then
  41. Sheets("Tabelle1").Cells(myRow2, myCol2 + 3) = myArr(myRow1, 1)
  42.  
  43. ElseIf myArr(myRow1, 6) = eqNo Then
  44. Sheets("Tabelle1").Cells(myRow2, myCol2 + 4) = myArr(myRow1, 1)
  45.  
  46. ElseIf myArr(myRow1, 7) = eqNo Then
  47. Sheets("Tabelle1").Cells(myRow2, myCol2 + 5) = myArr(myRow1, 1)
  48.  
  49. ElseIf myArr(myRow1, 8) = eqNo Then
  50. Sheets("Tabelle1").Cells(myRow2, myCol2 + 6) = myArr(myRow1, 1)
  51.  
  52. End If
  53.  
  54. myCol2 = myCol2 + 7
  55.  
  56. Next myRow1
  57.  
  58. eqNo = eqNo + 1
  59.  
  60. Next myRow2
  61.  
  62. End With
  63.  
  64. ActiveSheet.Protect
  65.  
  66.  
  67.  
  68. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement