Je lis une cellule format standart et je voudrai lui aplliquer apr=E8s
copy le format =E0 90=B0
Voici la macro que j'utilise mais il y a un bug.
Sub synth=E8se()
x =3D 19
For i =3D 1 To 12
Sheets(i).Range("f1").Copy Sheets("Synthese").Cells(4, 3 + i)
'format de la cellule (cells(4,3+i)) apr=E8s copy
.HorizontalAlignment =3D xlCenter
.VerticalAlignment =3D xlCenter
.WrapText =3D False
.Orientation =3D 90
.AddIndent =3D False
.IndentLevel =3D 0
.ShrinkToFit =3D True
.ReadingOrder =3D xlContext
.MergeCells =3D False
Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i)
Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x)
Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x)
x =3D x + 4
Next
End Sub
J'ai un blocage =E0 la ligne: .HorizontalAlignment =3D xlCenter
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Fredo P.
Il manque au minimum cela With selection 'format de la cellule (cells(4,3+i)) après copy .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = False .Orientation = 90 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = True .ReadingOrder = xlContext .MergeCells = False End With Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i) Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x) Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x) x = x + 4 Next End Sub
J'ai un blocage à la ligne: .HorizontalAlignment = xlCenter
Merci pour votre aide JP
Il manque au minimum cela
With selection
'format de la cellule (cells(4,3+i)) après copy
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = True
.ReadingOrder = xlContext
.MergeCells = False
End With
Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i)
Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x)
Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x)
x = x + 4
Next
End Sub
J'ai un blocage à la ligne: .HorizontalAlignment = xlCenter
Il manque au minimum cela With selection 'format de la cellule (cells(4,3+i)) après copy .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = False .Orientation = 90 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = True .ReadingOrder = xlContext .MergeCells = False End With Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i) Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x) Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x) x = x + 4 Next End Sub
J'ai un blocage à la ligne: .HorizontalAlignment = xlCenter
Merci pour votre aide JP
Brunos
Bonjour JP Je pense que tu as oublié un bloc with-end with. Essaie:
Sub synthèse() x = 19 For i = 1 To 12 Sheets(i).Range("f1").Copy Sheets("Synthese").Cells(4, 3 + i)
'format de la cellule (cells(4,3+i)) après copy With Sheets("Synthese").Cells(4, 3 + i) .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = False .Orientation = 90 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = True .ReadingOrder = xlContext .MergeCells = Fals End With
Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i) Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x) Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x) x = x + 4 Next End Sub
Brunos
a écrit dans le message de news:
Bonjour,
Je lis une cellule format standart et je voudrai lui aplliquer après copy le format à 90° Voici la macro que j'utilise mais il y a un bug. Sub synthèse() x = 19 For i = 1 To 12 Sheets(i).Range("f1").Copy Sheets("Synthese").Cells(4, 3 + i) 'format de la cellule (cells(4,3+i)) après copy .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = False .Orientation = 90 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = True .ReadingOrder = xlContext .MergeCells = False Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i) Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x) Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x) x = x + 4 Next End Sub
J'ai un blocage à la ligne: .HorizontalAlignment = xlCenter
Merci pour votre aide JP
Bonjour JP
Je pense que tu as oublié un bloc with-end with.
Essaie:
Sub synthèse()
x = 19
For i = 1 To 12
Sheets(i).Range("f1").Copy Sheets("Synthese").Cells(4, 3 + i)
'format de la cellule (cells(4,3+i)) après copy
With Sheets("Synthese").Cells(4, 3 + i)
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = True
.ReadingOrder = xlContext
.MergeCells = Fals
End With
Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i)
Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x)
Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x)
x = x + 4
Next
End Sub
Brunos
<jpierrethillard@orange.fr> a écrit dans le message de news:
13b1516a-1df1-47ee-879e-0050a914cc73@k2g2000hse.googlegroups.com...
Bonjour,
Je lis une cellule format standart et je voudrai lui aplliquer après
copy le format à 90°
Voici la macro que j'utilise mais il y a un bug.
Sub synthèse()
x = 19
For i = 1 To 12
Sheets(i).Range("f1").Copy Sheets("Synthese").Cells(4, 3 + i)
'format de la cellule (cells(4,3+i)) après copy
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = True
.ReadingOrder = xlContext
.MergeCells = False
Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i)
Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x)
Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x)
x = x + 4
Next
End Sub
J'ai un blocage à la ligne: .HorizontalAlignment = xlCenter
Bonjour JP Je pense que tu as oublié un bloc with-end with. Essaie:
Sub synthèse() x = 19 For i = 1 To 12 Sheets(i).Range("f1").Copy Sheets("Synthese").Cells(4, 3 + i)
'format de la cellule (cells(4,3+i)) après copy With Sheets("Synthese").Cells(4, 3 + i) .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = False .Orientation = 90 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = True .ReadingOrder = xlContext .MergeCells = Fals End With
Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i) Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x) Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x) x = x + 4 Next End Sub
Brunos
a écrit dans le message de news:
Bonjour,
Je lis une cellule format standart et je voudrai lui aplliquer après copy le format à 90° Voici la macro que j'utilise mais il y a un bug. Sub synthèse() x = 19 For i = 1 To 12 Sheets(i).Range("f1").Copy Sheets("Synthese").Cells(4, 3 + i) 'format de la cellule (cells(4,3+i)) après copy .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = False .Orientation = 90 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = True .ReadingOrder = xlContext .MergeCells = False Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i) Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x) Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x) x = x + 4 Next End Sub
J'ai un blocage à la ligne: .HorizontalAlignment = xlCenter
Merci pour votre aide JP
jpierrethillard
Fredo
Oui merci. Un oubli grossier de ma part! J'ai ajouté la ligne suivante juste après le With selection Cells(4, 3 + i).Select
J'ai conservé seulement la ligne: .Orientation = 90 Sinon la macro prend beaucoup trop de temps pour s'exécuter. Je pensais qu'il y avait une autre solution pour que mes copies se fassent plus rapidement.
Merci encore JP
On 13 jan, 11:38, "Fredo P." wrote:
Il manque au minimum cela With selection 'format de la cellule (cells(4,3+i)) après copy .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = False .Orientation = 90 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = True .ReadingOrder = xlContext .MergeCells = False End With Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i) Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x) Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x) x = x + 4 Next End Sub
J'ai un blocage à la ligne: .HorizontalAlignment = xlCenter
Merci pour votre aide JP
Fredo
Oui merci. Un oubli grossier de ma part!
J'ai ajouté la ligne suivante juste après le
With selection
Cells(4, 3 + i).Select
J'ai conservé seulement la ligne: .Orientation = 90
Sinon la macro prend beaucoup trop de temps pour s'exécuter.
Je pensais qu'il y avait une autre solution pour que mes copies se
fassent plus rapidement.
Merci encore
JP
On 13 jan, 11:38, "Fredo P."
<ponsinet.frederic363etdesbrouet...@orange.fr> wrote:
Il manque au minimum cela
With selection
'format de la cellule (cells(4,3+i)) après copy
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = True
.ReadingOrder = xlContext
.MergeCells = False
End With
Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i)
Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x)
Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x)
x = x + 4
Next
End Sub
J'ai un blocage à la ligne: .HorizontalAlignment = xlCenter
Oui merci. Un oubli grossier de ma part! J'ai ajouté la ligne suivante juste après le With selection Cells(4, 3 + i).Select
J'ai conservé seulement la ligne: .Orientation = 90 Sinon la macro prend beaucoup trop de temps pour s'exécuter. Je pensais qu'il y avait une autre solution pour que mes copies se fassent plus rapidement.
Merci encore JP
On 13 jan, 11:38, "Fredo P." wrote:
Il manque au minimum cela With selection 'format de la cellule (cells(4,3+i)) après copy .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = False .Orientation = 90 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = True .ReadingOrder = xlContext .MergeCells = False End With Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i) Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x) Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x) x = x + 4 Next End Sub
J'ai un blocage à la ligne: .HorizontalAlignment = xlCenter
Merci pour votre aide JP
Brunos
Suggestion pour accélérer ce genre de code : Application.ScreenUpdating = False ' en début de code et remettre à True à la fin. Brunos
a écrit dans le message de news:
Fredo
Oui merci. Un oubli grossier de ma part! J'ai ajouté la ligne suivante juste après le With selection Cells(4, 3 + i).Select
J'ai conservé seulement la ligne: .Orientation = 90 Sinon la macro prend beaucoup trop de temps pour s'exécuter. Je pensais qu'il y avait une autre solution pour que mes copies se fassent plus rapidement.
Merci encore JP
On 13 jan, 11:38, "Fredo P." wrote:
Il manque au minimum cela With selection 'format de la cellule (cells(4,3+i)) après copy .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = False .Orientation = 90 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = True .ReadingOrder = xlContext .MergeCells = False End With Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i) Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x) Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x) x = x + 4 Next End Sub
J'ai un blocage à la ligne: .HorizontalAlignment = xlCenter
Merci pour votre aide JP
Suggestion pour accélérer ce genre de code :
Application.ScreenUpdating = False ' en début de code
et remettre à True à la fin.
Brunos
<jpierrethillard@orange.fr> a écrit dans le message de news:
7d9499c0-cca7-4f76-a1c9-3b99330d5b17@s13g2000prd.googlegroups.com...
Fredo
Oui merci. Un oubli grossier de ma part!
J'ai ajouté la ligne suivante juste après le
With selection
Cells(4, 3 + i).Select
J'ai conservé seulement la ligne: .Orientation = 90
Sinon la macro prend beaucoup trop de temps pour s'exécuter.
Je pensais qu'il y avait une autre solution pour que mes copies se
fassent plus rapidement.
Merci encore
JP
On 13 jan, 11:38, "Fredo P."
<ponsinet.frederic363etdesbrouet...@orange.fr> wrote:
Il manque au minimum cela
With selection
'format de la cellule (cells(4,3+i)) après copy
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = True
.ReadingOrder = xlContext
.MergeCells = False
End With
Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i)
Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x)
Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x)
x = x + 4
Next
End Sub
J'ai un blocage à la ligne: .HorizontalAlignment = xlCenter
Suggestion pour accélérer ce genre de code : Application.ScreenUpdating = False ' en début de code et remettre à True à la fin. Brunos
a écrit dans le message de news:
Fredo
Oui merci. Un oubli grossier de ma part! J'ai ajouté la ligne suivante juste après le With selection Cells(4, 3 + i).Select
J'ai conservé seulement la ligne: .Orientation = 90 Sinon la macro prend beaucoup trop de temps pour s'exécuter. Je pensais qu'il y avait une autre solution pour que mes copies se fassent plus rapidement.
Merci encore JP
On 13 jan, 11:38, "Fredo P." wrote:
Il manque au minimum cela With selection 'format de la cellule (cells(4,3+i)) après copy .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = False .Orientation = 90 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = True .ReadingOrder = xlContext .MergeCells = False End With Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i) Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x) Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x) x = x + 4 Next End Sub
J'ai un blocage à la ligne: .HorizontalAlignment = xlCenter
Merci pour votre aide JP
jpierrethillard
Brunos,
Effectivement c'est incomparable.
Merci JP
On 13 jan, 12:17, "Brunos" wrote:
Suggestion pour accélérer ce genre de code : Application.ScreenUpdating = False ' en début de code et remettre à True à la fin. Brunos
a écrit dans le message de news:
Fredo
Oui merci. Un oubli grossier de ma part! J'ai ajouté la ligne suivante juste après le With selection Cells(4, 3 + i).Select
J'ai conservé seulement la ligne: .Orientation = 90 Sinon la macro prend beaucoup trop de temps pour s'exécuter. Je pensais qu'il y avait une autre solution pour que mes copies se fassent plus rapidement.
Merci encore JP
On 13 jan, 11:38, "Fredo P."
wrote:
Il manque au minimum cela With selection 'format de la cellule (cells(4,3+i)) après copy .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = False .Orientation = 90 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = True .ReadingOrder = xlContext .MergeCells = False End With Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i) Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x) Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x) x = x + 4 Next End Sub
J'ai un blocage à la ligne: .HorizontalAlignment = xlCenter
Merci pour votre aide JP- Masquer le texte des messages précédents -
- Afficher le texte des messages précédents -
Brunos,
Effectivement c'est incomparable.
Merci
JP
On 13 jan, 12:17, "Brunos" <pasdem...@moi.mezig> wrote:
Suggestion pour accélérer ce genre de code :
Application.ScreenUpdating = False ' en début de code
et remettre à True à la fin.
Brunos
<jpierrethill...@orange.fr> a écrit dans le message de news:
7d9499c0-cca7-4f76-a1c9-3b99330d5...@s13g2000prd.googlegroups.com...
Fredo
Oui merci. Un oubli grossier de ma part!
J'ai ajouté la ligne suivante juste après le
With selection
Cells(4, 3 + i).Select
J'ai conservé seulement la ligne: .Orientation = 90
Sinon la macro prend beaucoup trop de temps pour s'exécuter.
Je pensais qu'il y avait une autre solution pour que mes copies se
fassent plus rapidement.
Il manque au minimum cela
With selection
'format de la cellule (cells(4,3+i)) après copy
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = True
.ReadingOrder = xlContext
.MergeCells = False
End With
Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i)
Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x)
Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x)
x = x + 4
Next
End Sub
J'ai un blocage à la ligne: .HorizontalAlignment = xlCenter
Merci pour votre aide
JP- Masquer le texte des messages précédents -
Suggestion pour accélérer ce genre de code : Application.ScreenUpdating = False ' en début de code et remettre à True à la fin. Brunos
a écrit dans le message de news:
Fredo
Oui merci. Un oubli grossier de ma part! J'ai ajouté la ligne suivante juste après le With selection Cells(4, 3 + i).Select
J'ai conservé seulement la ligne: .Orientation = 90 Sinon la macro prend beaucoup trop de temps pour s'exécuter. Je pensais qu'il y avait une autre solution pour que mes copies se fassent plus rapidement.
Merci encore JP
On 13 jan, 11:38, "Fredo P."
wrote:
Il manque au minimum cela With selection 'format de la cellule (cells(4,3+i)) après copy .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = False .Orientation = 90 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = True .ReadingOrder = xlContext .MergeCells = False End With Sheets(i).Range("c5:c64").Copy Sheets("Synthese").Cells(5, 3 + i) Sheets(i).Range("g6:j41").Copy Sheets("Synthese").Cells(6, x) Sheets(i).Range("g48:j54").Copy Sheets("Synthese").Cells(48, x) x = x + 4 Next End Sub
J'ai un blocage à la ligne: .HorizontalAlignment = xlCenter
Merci pour votre aide JP- Masquer le texte des messages précédents -