WCM Forum

WCM Forum (http://www.wcm.at/forum/index.php)
-   Software (http://www.wcm.at/forum/forumdisplay.php?f=5)
-   -   Brauche Hilfe bei Excel (http://www.wcm.at/forum/showthread.php?t=141520)

Phantomias 10.08.2004 18:30

Brauche Hilfe bei Excel
 
Hi

Bräuchte Eure Hilfe bei einem kleinen Excel-Problem..

Folgendes:

Ich muss Daten in eine bestimmte Reihenfolge bringen, die kurzgefasst so aussieht:
(Also die aufgezählten Zellen sollen so untereinander gereiht werden)

A3
E3
E4
A4
A5
E5
E6
A6
A7
E7
E8
A8

usw....

Sieht doch ganz simpel aus, und kann sicherlich nicht so schwer sein, aber ich bin heute jedenfalls nicht dahinter gekommen

:confused: :rolleyes:

Dankeschön :)

Ich denke mir mit einem Makro geht das sicher schnell - nur kenn ich mich mit VBA Makros ned aus *räusper*

pc.net 10.08.2004 21:24

splitte doch einfach den wert der jeweiligen zelle ...

also aus dem wert "A3" in zelle A1 wird durch
*) einfügen der formel "=TEIL(A1;1;1)" in zelle B1 der wert "A" ...
*) einfügen der formel "=TEIL(A1;2;1)" in zelle C1 der wert "3" ...

diese formeln kopierst du in alle felder in spalte B und C ... danach ein sortieren (menü daten | sortieren) zuerst nach spalte C und dann B und die sache ist erledigt ;)

sh. beispiel im anhang ;)

Phantomias 10.08.2004 22:18

hmmm... *grübel*

Danke für deine Mühen ;)

aber ich glaube das bringt mir gar nichts..

Vielleicht habe ich es auch ungeschickt formuliert??

die Reihenfolge die ich aufgeschrieben habe , soll das Ergebnis sein..

A3 bedeutet Zelle A3
E3 bedeutet Zelle E3

das sind nicht die Werte die drinnen stehen..

Phantomias 10.08.2004 22:26

hier die Datei:

pc.net 10.08.2004 22:30

verstehe :verwirrt: ...

möglicherweise geht das mit einer pivot-tabelle (im menü daten) ...

flinx 10.08.2004 23:32

Versuchs mit:
Code:

Sub umreihen()
Dim i, j, k, l As Integer
i = 3
j = 1
k = 3
l = 9
Application.ScreenUpdating = False
While ActiveWorkbook.Sheets(1).Cells(i, j).Value <> ""

ActiveWorkbook.Sheets(1).Cells(k, l).Value = ActiveWorkbook.Sheets(1).Cells(i, j).Value
ActiveWorkbook.Sheets(1).Cells(k, l + 1).Value = ActiveWorkbook.Sheets(1).Cells(i, j + 1).Value
ActiveWorkbook.Sheets(1).Cells(k, l + 2).Value = ActiveWorkbook.Sheets(1).Cells(i, j + 2).Value
k = k + 1
ActiveWorkbook.Sheets(1).Cells(k, l).Value = ActiveWorkbook.Sheets(1).Cells(i, j + 4).Value
ActiveWorkbook.Sheets(1).Cells(k, l + 1).Value = ActiveWorkbook.Sheets(1).Cells(i, j + 5).Value
ActiveWorkbook.Sheets(1).Cells(k, l + 2).Value = ActiveWorkbook.Sheets(1).Cells(i, j + 6).Value
k = k + 1
i = i + 1
ActiveWorkbook.Sheets(1).Cells(k, l).Value = ActiveWorkbook.Sheets(1).Cells(i, j + 4).Value
ActiveWorkbook.Sheets(1).Cells(k, l + 1).Value = ActiveWorkbook.Sheets(1).Cells(i, j + 5).Value
ActiveWorkbook.Sheets(1).Cells(k, l + 2).Value = ActiveWorkbook.Sheets(1).Cells(i, j + 6).Value
k = k + 1
ActiveWorkbook.Sheets(1).Cells(k, l).Value = ActiveWorkbook.Sheets(1).Cells(i, j).Value
ActiveWorkbook.Sheets(1).Cells(k, l + 1).Value = ActiveWorkbook.Sheets(1).Cells(i, j + 1).Value
ActiveWorkbook.Sheets(1).Cells(k, l + 2).Value = ActiveWorkbook.Sheets(1).Cells(i, j + 2).Value
k = k + 1

i = i + 1
Wend
Application.ScreenUpdating = True
End Sub

Ohne Gewähr! ;)

wbendl 11.08.2004 00:02

Hi!

flinx war wohl schneller.

Ich habe keine Tabelle angegeben. Es wird immer das aktive Blatt verwendet.
Der Code ist glaube ich selbsterklärend.

Sub Sortieren()

Dim intSourceRow As Integer
Dim intSourceCol As Integer
Dim intDestRow As Integer
Dim intDestCol As Integer

Dim intLoopCounter As Integer

intSourceRow = 3
intSourceCol = 1
intDestRow = 3
intDestCol = 9

For intLoopCounter = 1 To 3

Do
Cells(intDestRow, intDestCol) = Cells(intSourceRow, intSourceCol)
intDestRow = intDestRow + 1
intSourceCol = intSourceCol + 4
Cells(intDestRow, intDestCol) = Cells(intSourceRow, intSourceCol)
intDestRow = intDestRow + 1
intSourceRow = intSourceRow + 1
Cells(intDestRow, intDestCol) = Cells(intSourceRow, intSourceCol)
intDestRow = intDestRow + 1
intSourceCol = intSourceCol - 4
Cells(intDestRow, intDestCol) = Cells(intSourceRow, intSourceCol)
intDestRow = intDestRow + 1
intSourceRow = intSourceRow + 1
Loop Until Cells(intSourceRow, intSourceCol) = ""

intSourceRow = 3
intDestRow = 3
intSourceCol = intSourceCol + 1
intDestCol = intDestCol + 1

Next intLoopCounter

End Sub

mfg

WB

Phantomias 11.08.2004 00:44

Dankeschon euch beiden!

Habs mit dem Code von wbendl probiert, hat funktioniert! :)


Alle Zeitangaben in WEZ +2. Es ist jetzt 14:31 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© 2009 FSL Verlag