Einzelnen Beitrag anzeigen
Alt 11.08.2004, 00:02   #7
wbendl
Master
 
Registriert seit: 22.03.2000
Alter: 66
Beiträge: 550


Standard

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
wbendl ist offline   Mit Zitat antworten