De row a colonne

polik

XLDnaute Junior
Bonjour a tous !

J'ai ce code qui transpose les résultats d'un userform vers une ligne...je voudrais qu'il se transpose vers une colonne

QUelqu'un a une idée ??

Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Base RO")

'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

ws.Cells(iRow, 1).Value = "Création"
ws.Cells(iRow, 2).Value = Date
ws.Cells(iRow, 3).Value = Me.G1.Value
ws.Cells(iRow, 4).Value = Me.G3.Value
ws.Cells(iRow, 5).Value = Me.G4.Value
ws.Cells(iRow, 6).Value = Me.G5.Value
ws.Cells(iRow, 7).Value = Me.G6.Value
ws.Cells(iRow, 8).Value = Me.G8.Value
ws.Cells(iRow, 9).Value = Me.G7.Value
ws.Cells(iRow, 10).Value = Me.G2.Value
ws.Cells(iRow, 11).Value = Me.G9.Value


Merci d'avance
 

Cousinhub

XLDnaute Barbatruc
Re : De row a colonne

Bonjour,

essaie avec ce code, non testé (n'ayant pas l'usf)

Code:
Dim iColumn As Integer
Dim ws As Worksheet
Set ws = Worksheets("Base RO")

'find first empty row in database
iColumn = ws.Cells(1, Columns.Count) _
.End(xlToLeft).Offset(0, 1).Column

ws.Cells(1, iColumn).Value = "Création"
ws.Cells(2, iColumn).Value = Date
ws.Cells(3, iColumn).Value = Me.G1.Value
ws.Cells(4, iColumn).Value = Me.G3.Value
ws.Cells(5, iColumn).Value = Me.G4.Value
ws.Cells(6, iColumn).Value = Me.G5.Value
ws.Cells(7, iColumn).Value = Me.G6.Value
ws.Cells(8, iColumn).Value = Me.G8.Value
ws.Cells(9, iColumn).Value = Me.G7.Value
ws.Cells(10, iColumn).Value = Me.G2.Value
ws.Cells(11, iColumn).Value = Me.G9.Value
 

tototiti2008

XLDnaute Barbatruc
Re : De row a colonne

Bonjour polik,

Sans doute avec :

'find first empty column in database
iCol = ws.Cells(1,Columns.Count).End(xlToLeft).Offset(0,1).Column

ws.Cells(2, iCol).Value = "Création"
...

bonjour bhbh, je suis trop lent...
 

Discussions similaires

Réponses
0
Affichages
175
Réponses
2
Affichages
294

Statistiques des forums

Discussions
312 438
Messages
2 088 410
Membres
103 845
dernier inscrit
anasabir2024