Sub trans()
Dim col As Integer
Dim origrow As Integer
Dim outrow As Integer
Dim datcol As Integer
outrow = 1
label1:
col = col + 1
If Worksheets("ORIGINAL").Cells(1, col) = "Blank" Then GoTo label2
datcol = col
Worksheets("Output").Cells(1, col + 1) = Worksheets("ORIGINAL").Cells(1, col)
GoTo label1
label2:
col = col + 1
origrow = 1
label3:
outrow = outrow + 1
origrow = origrow + 1
Worksheets("Output").Cells(outrow, 1) = Worksheets("ORIGINAL").Cells(1, col)
For x = 1 To (datcol)
Worksheets("Output").Cells(outrow, x + 1) = Worksheets("ORIGINAL").Cells(origrow, x)
Next x
Worksheets("Output").Cells(outrow, x + 1) = Worksheets("ORIGINAL").Cells(origrow, col)
If Worksheets("ORIGINAL").Cells(origrow + 1, col) <> 0 Then GoTo label3
If Worksheets("ORIGINAL").Cells(1, col + 1) <> 0 Then GoTo label2
End Sub
Bookmarks