Thema Datum  Von Nutzer Rating
Antwort
09.01.2016 13:54:13 Matthias
NotSolved
09.01.2016 15:17:51 Gast23553
NotSolved
09.01.2016 19:35:30 Matthias
NotSolved
10.01.2016 15:10:50 Matthias
NotSolved
10.01.2016 17:06:45 Matthias
NotSolved
10.01.2016 18:07:08 Gast47001
NotSolved
10.01.2016 18:16:23 Matthias
NotSolved
10.01.2016 19:18:07 Gast78858
NotSolved
10.01.2016 19:44:03 Matthias
NotSolved
Blau Daten auf einzelne Sheets aufteilen
10.01.2016 20:37:49 Gast75511
NotSolved
10.01.2016 22:20:14 Peter
NotSolved
10.01.2016 22:53:57 Gast93497
NotSolved
11.01.2016 18:34:16 Matthias
NotSolved
11.01.2016 20:58:11 Gast24821
NotSolved
12.01.2016 19:03:51 Matthias
NotSolved
12.01.2016 20:46:37 Matthias
NotSolved
16.01.2016 10:28:33 Matthias
NotSolved
16.01.2016 11:35:23 Gast7340
NotSolved
16.01.2016 13:43:18 Matthias
NotSolved
16.01.2016 20:27:06 Gast59546
NotSolved
16.01.2016 20:43:49 Matthias
NotSolved
16.01.2016 23:05:06 Gast27892
NotSolved
17.01.2016 10:36:14 Matthias
NotSolved
17.01.2016 12:34:32 Matthias
NotSolved
17.01.2016 13:21:30 Gast21379
NotSolved
17.01.2016 14:17:36 Matthias
NotSolved
17.01.2016 14:51:02 Gast31799
NotSolved
17.01.2016 15:38:49 Matthias
NotSolved
17.01.2016 17:43:45 Gast59516
NotSolved
17.01.2016 18:06:12 Gast90961
NotSolved
17.01.2016 18:30:40 Gast8489
NotSolved
17.01.2016 18:48:34 Matthias
Solved
17.01.2016 19:11:44 Gast41059
NotSolved

Ansicht des Beitrags:
Von:
Gast75511
Datum:
10.01.2016 20:37:49
Views:
737
Rating: Antwort:
  Ja
Thema:
Daten auf einzelne Sheets aufteilen

Hallo! Ich würde gerne helfen, was aber derzeit irgendwie nicht genau, was der Code genau machen soll und welche Rolle A, B, C spielen. Ich dachte in Spalte 23 kommt nur entweder A, B, C vor und danach entscheidet sich was der Code machen soll.

Also egal ob A, B, C steht, werden 12 Blätter eingefügt und jeweils auch Spalte A bis D. Bei A oder B kommen dann noch die jeweilig die Spalte vom Idex i dazu und bei C kommt nur bei Blatt 19 bis 22 diese Spalte. Richtig?

Oder soll wenn A oder B drin steht 12 Blätter mit A:D und der Spalte nach I und wenn auch noch ein C vorkommt, nochmal 4 Blätter aber nur noch die Spalten 19 bis 22 reinkopiert werden? Also für die letzte Version ist der Code unten.  Ansonsten bitte nochmal darstellen. Gruß

 

Sub Verteile()
Dim i As Long
Dim anfang As Long
Dim ende As Long
Dim suche
Dim suche2
Dim suche3
Dim gefunden As Boolean
  
Application.ScreenUpdating = False

Set suche = Worksheets("Tabelle1").Columns(23).Find("A", lookat:=xlWhole, LookIn:=xlValues)
Set suche2 = Worksheets("Tabelle1").Columns(23).Find("B", lookat:=xlWhole, LookIn:=xlValues)
Set suche3 = Worksheets("Tabelle1").Columns(23).Find("C", lookat:=xlWhole, LookIn:=xlValues)
 
If suche = "A" Or suche2 = "B" Then
With Tabelle1
   For i = 10 To 22
      Worksheets.Add After:=Sheets(Sheets.Count)
      '.UsedRange.Range("A:D").Copy ActiveSheet.Cells(1)
      .UsedRange.Columns(i).Copy ActiveSheet.Cells(1, 5)
      ActiveSheet.Name = Cells(1, 5)
   Next
End With
End If

If suche3 = "C" Then
With Tabelle1
   For i = 1 To 4
      Worksheets.Add After:=Sheets(Sheets.Count)
      .UsedRange.Range("A:D").Copy ActiveSheet.Cells(1)
      .UsedRange.Columns(i + 18).Copy ActiveSheet.Cells(1, 5)
      ActiveSheet.Name = Cells(1, 5) & "C"
   Next
End With
End If

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
09.01.2016 13:54:13 Matthias
NotSolved
09.01.2016 15:17:51 Gast23553
NotSolved
09.01.2016 19:35:30 Matthias
NotSolved
10.01.2016 15:10:50 Matthias
NotSolved
10.01.2016 17:06:45 Matthias
NotSolved
10.01.2016 18:07:08 Gast47001
NotSolved
10.01.2016 18:16:23 Matthias
NotSolved
10.01.2016 19:18:07 Gast78858
NotSolved
10.01.2016 19:44:03 Matthias
NotSolved
Blau Daten auf einzelne Sheets aufteilen
10.01.2016 20:37:49 Gast75511
NotSolved
10.01.2016 22:20:14 Peter
NotSolved
10.01.2016 22:53:57 Gast93497
NotSolved
11.01.2016 18:34:16 Matthias
NotSolved
11.01.2016 20:58:11 Gast24821
NotSolved
12.01.2016 19:03:51 Matthias
NotSolved
12.01.2016 20:46:37 Matthias
NotSolved
16.01.2016 10:28:33 Matthias
NotSolved
16.01.2016 11:35:23 Gast7340
NotSolved
16.01.2016 13:43:18 Matthias
NotSolved
16.01.2016 20:27:06 Gast59546
NotSolved
16.01.2016 20:43:49 Matthias
NotSolved
16.01.2016 23:05:06 Gast27892
NotSolved
17.01.2016 10:36:14 Matthias
NotSolved
17.01.2016 12:34:32 Matthias
NotSolved
17.01.2016 13:21:30 Gast21379
NotSolved
17.01.2016 14:17:36 Matthias
NotSolved
17.01.2016 14:51:02 Gast31799
NotSolved
17.01.2016 15:38:49 Matthias
NotSolved
17.01.2016 17:43:45 Gast59516
NotSolved
17.01.2016 18:06:12 Gast90961
NotSolved
17.01.2016 18:30:40 Gast8489
NotSolved
17.01.2016 18:48:34 Matthias
Solved
17.01.2016 19:11:44 Gast41059
NotSolved