Comment aligner les champs dans Ecxel par du code VB?

Labon Messages postés 18 Date d'inscription lundi 3 février 2003 Statut Membre Dernière intervention 3 mai 2011 - 3 févr. 2003 à 18:01
Labon Messages postés 18 Date d'inscription lundi 3 février 2003 Statut Membre Dernière intervention 3 mai 2011 - 4 févr. 2003 à 15:43
J'essaie depuis hier et ça ne marche pas...

J'ai essayé ceci...

Set oExcel = New Excel.Application
Set oWorkbook = oExcel.Workbooks.Add
Set oWorksheet = oWorkbook.Worksheets(1)

oWorksheet.Name = "RAPPORT"

oExcel.Visible = True
oWorksheet.Activate

Range("A3:L3").Select
Selection.ShapeRange.Align 3, False

Qu'est-ce qui ne marche pas???

2 réponses

pelw Messages postés 148 Date d'inscription dimanche 12 janvier 2003 Statut Membre Dernière intervention 14 février 2005 6
3 févr. 2003 à 23:19
'Aligner à gauche
Range("A3:L3").HorizontalAlignment = xlLeft

'Aligner à droite
Range("A3:L3").HorizontalAlignment = xlRight

'Centrer
Range("A3:L3").HorizontalAlignment = xlCenter

'Supprimer l'alignement
Range("A3:L3").HorizontalAlignment = xlGeneral

@+

pelw
0
Labon Messages postés 18 Date d'inscription lundi 3 février 2003 Statut Membre Dernière intervention 3 mai 2011
4 févr. 2003 à 15:43
Merci beaucoup pelw :)
0
Rejoignez-nous