Thema Datum  Von Nutzer Rating
Antwort
03.02.2018 12:39:12 Saied
NotSolved
03.02.2018 13:24:00 Werner
NotSolved
Rot Kopieren von mehreren Zellen und Bereichen und einfügen
03.02.2018 13:35:03 Gast56473
NotSolved
03.02.2018 15:01:25 Werner
NotSolved

Ansicht des Beitrags:
Von:
Gast56473
Datum:
03.02.2018 13:35:03
Views:
600
Rating: Antwort:
  Ja
Thema:
Kopieren von mehreren Zellen und Bereichen und einfügen

Danke für die schnelle Antwort! Es hängt noch an dem fett markierten. Da bräuchte ich noch eine Lösung, damit der Code auch transponiert einfügt:

Sub CopyPrim()
 
Dim lngRow As Long
Dim lngRowmax As Long
Dim lngn As Long
Dim lngz As Long
 
lngn = 2
 
With Worksheets("Mapping_#1")
 
lngRowmax = .UsedRange.Rows.Count
 
For lngRow = 4 To lngRowmax
 
If .Cells(lngRow, 17).Value <> "" Then
.Cells(lngRow, 17).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 6)
.Cells(lngRow, 18).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 7)
.Cells(lngRow, 3).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 8)
.Cells(lngRow, 4).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 9)
.Cells(lngRow, 6).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 10)
.Cells(lngRow, 8).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 12)
.Range(Cells(lngRow, 21), Cells(lngRow, 22)).copy
Worksheets("GL_Cust_1001_Makro").Range("Q2").PasteSpecial _
Paste:=xlPasteValues, Transpose:=True
Application.CutCopyMode = False
 
lngn = Worksheets("GL_Cust_1001_Makro").UsedRange.Rows.Count + 1
.Cells(lngRow, 17).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 6)
.Cells(lngRow, 18).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 7)
.Cells(lngRow, 3).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 8)
.Cells(lngRow, 4).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 9)
.Cells(lngRow, 6).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 10)
.Cells(lngRow, 8).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 12)
lngn = Worksheets("GL_Cust_1001_Makro").UsedRange.Rows.Count + 1
.Cells(lngRow, 17).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 6)
.Cells(lngRow, 18).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 7)
.Cells(lngRow, 3).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 8)
.Cells(lngRow, 4).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 9)
.Cells(lngRow, 6).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 10)
.Cells(lngRow, 8).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 12)
lngn = Worksheets("GL_Cust_1001_Makro").UsedRange.Rows.Count + 1
.Cells(lngRow, 17).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 6)
.Cells(lngRow, 18).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 7)
.Cells(lngRow, 3).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 8)
.Cells(lngRow, 4).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 9)
.Cells(lngRow, 6).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 10)
.Cells(lngRow, 8).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 12)
lngn = Worksheets("GL_Cust_1001_Makro").UsedRange.Rows.Count + 1
.Cells(lngRow, 17).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 6)
.Cells(lngRow, 18).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 7)
.Cells(lngRow, 3).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 8)
.Cells(lngRow, 4).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 9)
.Cells(lngRow, 6).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 10)
.Cells(lngRow, 8).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 12)
lngn = Worksheets("GL_Cust_1001_Makro").UsedRange.Rows.Count + 1
.Cells(lngRow, 17).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 6)
.Cells(lngRow, 18).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 7)
.Cells(lngRow, 3).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 8)
.Cells(lngRow, 4).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 9)
.Cells(lngRow, 6).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 10)
.Cells(lngRow, 8).copy Destination:=Worksheets("GL_Cust_1001_Makro").Cells(lngn, 12)
lngn = Worksheets("GL_Cust_1001_Makro").UsedRange.Rows.Count + 1
 
End If
 
Next lngRow
 
End With
 
End Sub

 


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
03.02.2018 12:39:12 Saied
NotSolved
03.02.2018 13:24:00 Werner
NotSolved
Rot Kopieren von mehreren Zellen und Bereichen und einfügen
03.02.2018 13:35:03 Gast56473
NotSolved
03.02.2018 15:01:25 Werner
NotSolved