Thread: Is it possible?
View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Is it possible?

JA,

You will n eed to tell me in words how the output is wrong because I cannot
un derstand your post layout, and it does what I understood from your
original message.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"JA" wrote in message
...
Hi Bob,
Thanks for the effort, but the output (below) is not
exactly the expected. Can you help further.

08/05/04 09/05/04 10/05/04
A
B
C
D
E




-----Original Message-----
Thank you sir, distracted with setting up a water feature

in the garden on
this gorgeous late spring day.

Bob

"Frank Kabel" wrote in message
...
Hi
these are both only ONE line. Combine them to a single

line and it
should work

--
Regards
Frank Kabel
Frankfurt, Germany


JA wrote:
I am expriencing compile error at the following lines:

Set oCell = .Range("A1").Resize(1, cCols).Find(Cells

(i,
"A").Value, , xlFormulas)

.Cells(cNewRow + 1, oCell.Column).Value = Cells(i,
"B").Value

-----Original Message-----
Here is a macro to place it on an other sheet

Sub transpose()
Dim cRows As Long
Dim cCols As Long
Dim cNewRow As Long
Dim i As Long
Dim oCell As Range

cRows = Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To cRows
With Worksheets("Sheet2")
cNewRow = Asc(Cells(i, "B").Value) - 64
cCols = .Cells(1, Columns.Count).End

(xlToLeft).Column
If .Range("A1") = "" Then
cCols = 0
Set oCell = Nothing
Else
Set oCell = .Range("A1").Resize(1,
cCols).Find(Cells(i, "A").Value, , xlFormulas)
End If
If oCell Is Nothing Then
.Cells(1, cCols + 1).Value = Cells
(i, "A").Value
.Cells(cNewRow + 1, cCols + 1).Value

= Cells(i,
"B").Value Else
.Cells(1, oCell.Column).Value = Cells

(i, "A").Value
.Cells(cNewRow + 1,

oCell.Column).Value = Cells(i,
"B").Value
End If
Set oCell = Nothing
End With
Next i
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the

Purbecks
(remove nothere from the email address if mailing

direct)

"JA" wrote in message
...
Is it possible to transpose Table 1 to Table 2 using
macros?

TABLE 1
Start_Date Course Duration
08/05/04 A 2
09/05/04 B 1
09/05/04 C 3
08/05/04 D 3
10/05/04 E 2

TABLE 2
08/05/04 09/05/04 10/05/04 11/05/04
A A
B
C C C
D D D
E E



.



.