Bonjour à toutes et à tous
J'ai lancé la création d'une macro pour récupérer
le code, mais je trouve qu'il est un peu long...
y a t-il un moyen pour raccoursisr ce code ?
(quand clik sur bouton, de B11:B15 cases sont
barrées en diagonales)
merci du tuyau
Sub Macro5()
Range("B11:C15").Select
With Selection.Borders(xlDiagonalDown)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlDiagonalUp)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideHorizontal).LineStyle =
xlNone
End Sub
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
FxM
Bonjour Michel,
Pas fondamentalement différent .. Je ne sais pourquoi Excel ne prend pas en compte les diagonales lorsque tu lui dis borders. Ca nous mène à un truc que j'aurais espéré encore un peu plus compact mais bon :o)
Sub Macro5() Range("B11:C15").Select With Selection With .Borders(xlDiagonalDown) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With .Borders(xlDiagonalUp) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With .Borders .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With .Borders(xlInsideHorizontal).LineStyle = xlNone End With End Sub
@+ FxM
Michel.P wrote:
Bonjour à toutes et à tous J'ai lancé la création d'une macro pour récupérer le code, mais je trouve qu'il est un peu long... y a t-il un moyen pour raccoursisr ce code ? (quand clik sur bouton, de B11:B15 cases sont barrées en diagonales)
merci du tuyau
Sub Macro5() Range("B11:C15").Select With Selection.Borders(xlDiagonalDown) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlDiagonalUp) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With Selection.Borders(xlInsideHorizontal).LineStyle = xlNone End Sub
Bonjour Michel,
Pas fondamentalement différent ..
Je ne sais pourquoi Excel ne prend pas en compte les diagonales lorsque
tu lui dis borders. Ca nous mène à un truc que j'aurais espéré encore un
peu plus compact mais bon :o)
Sub Macro5()
Range("B11:C15").Select
With Selection
With .Borders(xlDiagonalDown)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With .Borders(xlDiagonalUp)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With .Borders
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
.Borders(xlInsideHorizontal).LineStyle = xlNone
End With
End Sub
@+
FxM
Michel.P wrote:
Bonjour à toutes et à tous
J'ai lancé la création d'une macro pour récupérer le code, mais je
trouve qu'il est un peu long...
y a t-il un moyen pour raccoursisr ce code ? (quand clik sur bouton, de
B11:B15 cases sont barrées en diagonales)
merci du tuyau
Sub Macro5()
Range("B11:C15").Select
With Selection.Borders(xlDiagonalDown)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlDiagonalUp)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
End Sub
Pas fondamentalement différent .. Je ne sais pourquoi Excel ne prend pas en compte les diagonales lorsque tu lui dis borders. Ca nous mène à un truc que j'aurais espéré encore un peu plus compact mais bon :o)
Sub Macro5() Range("B11:C15").Select With Selection With .Borders(xlDiagonalDown) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With .Borders(xlDiagonalUp) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With .Borders .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With .Borders(xlInsideHorizontal).LineStyle = xlNone End With End Sub
@+ FxM
Michel.P wrote:
Bonjour à toutes et à tous J'ai lancé la création d'une macro pour récupérer le code, mais je trouve qu'il est un peu long... y a t-il un moyen pour raccoursisr ce code ? (quand clik sur bouton, de B11:B15 cases sont barrées en diagonales)
merci du tuyau
Sub Macro5() Range("B11:C15").Select With Selection.Borders(xlDiagonalDown) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlDiagonalUp) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With Selection.Borders(xlInsideHorizontal).LineStyle = xlNone End Sub
michdenis
Bonjour Michel,
'--------------------------- Sub Macro5() With Range("B11:C15") .BorderAround xlContinuous, xlMedium, xlColorIndexAutomatic With .Borders(xlDiagonalDown) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With .Borders(xlDiagonalUp) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With End With
End Sub '---------------------------
Salutations!
"Michel.P" a écrit dans le message de news: Bonjour à toutes et à tous J'ai lancé la création d'une macro pour récupérer le code, mais je trouve qu'il est un peu long... y a t-il un moyen pour raccoursisr ce code ? (quand clik sur bouton, de B11:B15 cases sont barrées en diagonales)
merci du tuyau
Sub Macro5() Range("B11:C15").Select With Selection.Borders(xlDiagonalDown) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlDiagonalUp) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With
Selection.Borders(xlInsideHorizontal).LineStyle xlNone End Sub
-- Amicalement Michel . P
Bonjour Michel,
'---------------------------
Sub Macro5()
With Range("B11:C15")
.BorderAround xlContinuous, xlMedium, xlColorIndexAutomatic
With .Borders(xlDiagonalDown)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With .Borders(xlDiagonalUp)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
End With
End Sub
'---------------------------
Salutations!
"Michel.P" <prive.ma-boite_sans_spam@laposte.net> a écrit dans le message de
news:mn.fbba7d47d5b11e17.11921@laposte.net...
Bonjour à toutes et à tous
J'ai lancé la création d'une macro pour récupérer
le code, mais je trouve qu'il est un peu long...
y a t-il un moyen pour raccoursisr ce code ?
(quand clik sur bouton, de B11:B15 cases sont
barrées en diagonales)
merci du tuyau
Sub Macro5()
Range("B11:C15").Select
With Selection.Borders(xlDiagonalDown)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlDiagonalUp)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideHorizontal).LineStyle xlNone
End Sub
'--------------------------- Sub Macro5() With Range("B11:C15") .BorderAround xlContinuous, xlMedium, xlColorIndexAutomatic With .Borders(xlDiagonalDown) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With .Borders(xlDiagonalUp) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With End With
End Sub '---------------------------
Salutations!
"Michel.P" a écrit dans le message de news: Bonjour à toutes et à tous J'ai lancé la création d'une macro pour récupérer le code, mais je trouve qu'il est un peu long... y a t-il un moyen pour raccoursisr ce code ? (quand clik sur bouton, de B11:B15 cases sont barrées en diagonales)
merci du tuyau
Sub Macro5() Range("B11:C15").Select With Selection.Borders(xlDiagonalDown) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlDiagonalUp) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With
Selection.Borders(xlInsideHorizontal).LineStyle xlNone End Sub
-- Amicalement Michel . P
michdenis
Bonjour Michel,
Il y a aussi ceci :
'------------------ Sub Macro5() Dim A As Integer With Range("B11:C15") .BorderAround xlContinuous, xlMedium, xlColorIndexAutomatic For A = 5 To 6 With .Borders(A) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With Next End With End Sub '------------------
Salutations!
"Michel.P" a écrit dans le message de news: Bonjour à toutes et à tous J'ai lancé la création d'une macro pour récupérer le code, mais je trouve qu'il est un peu long... y a t-il un moyen pour raccoursisr ce code ? (quand clik sur bouton, de B11:B15 cases sont barrées en diagonales)
merci du tuyau
Sub Macro5() Range("B11:C15").Select With Selection.Borders(xlDiagonalDown) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlDiagonalUp) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With
Selection.Borders(xlInsideHorizontal).LineStyle xlNone End Sub
-- Amicalement Michel . P
Bonjour Michel,
Il y a aussi ceci :
'------------------
Sub Macro5()
Dim A As Integer
With Range("B11:C15")
.BorderAround xlContinuous, xlMedium, xlColorIndexAutomatic
For A = 5 To 6
With .Borders(A)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Next
End With
End Sub
'------------------
Salutations!
"Michel.P" <prive.ma-boite_sans_spam@laposte.net> a écrit dans le message de
news:mn.fbba7d47d5b11e17.11921@laposte.net...
Bonjour à toutes et à tous
J'ai lancé la création d'une macro pour récupérer
le code, mais je trouve qu'il est un peu long...
y a t-il un moyen pour raccoursisr ce code ?
(quand clik sur bouton, de B11:B15 cases sont
barrées en diagonales)
merci du tuyau
Sub Macro5()
Range("B11:C15").Select
With Selection.Borders(xlDiagonalDown)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlDiagonalUp)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideHorizontal).LineStyle xlNone
End Sub
'------------------ Sub Macro5() Dim A As Integer With Range("B11:C15") .BorderAround xlContinuous, xlMedium, xlColorIndexAutomatic For A = 5 To 6 With .Borders(A) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With Next End With End Sub '------------------
Salutations!
"Michel.P" a écrit dans le message de news: Bonjour à toutes et à tous J'ai lancé la création d'une macro pour récupérer le code, mais je trouve qu'il est un peu long... y a t-il un moyen pour raccoursisr ce code ? (quand clik sur bouton, de B11:B15 cases sont barrées en diagonales)
merci du tuyau
Sub Macro5() Range("B11:C15").Select With Selection.Borders(xlDiagonalDown) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlDiagonalUp) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With
Selection.Borders(xlInsideHorizontal).LineStyle xlNone End Sub
-- Amicalement Michel . P
¤ve
Salut Michel, Voilà : Sub Macro5() Dim I As Integer For I = 5 To 10 With [B11:C15].Borders(I) .LineStyle = 1 .Weight = -4138 End With Next I End Sub
Hervé.
"Michel.P" a écrit dans le message de news:
Bonjour à toutes et à tous J'ai lancé la création d'une macro pour récupérer le code, mais je trouve qu'il est un peu long... y a t-il un moyen pour raccoursisr ce code ? (quand clik sur bouton, de B11:B15 cases sont barrées en diagonales)
merci du tuyau
Sub Macro5() Range("B11:C15").Select With Selection.Borders(xlDiagonalDown) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlDiagonalUp) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With
Selection.Borders(xlInsideHorizontal).LineStyle > xlNone End Sub
-- Amicalement Michel . P
Salut Michel,
Voilà :
Sub Macro5()
Dim I As Integer
For I = 5 To 10
With [B11:C15].Borders(I)
.LineStyle = 1
.Weight = -4138
End With
Next I
End Sub
Hervé.
"Michel.P" <prive.ma-boite_sans_spam@laposte.net> a écrit dans le message de
news: mn.fbba7d47d5b11e17.11921@laposte.net...
Bonjour à toutes et à tous
J'ai lancé la création d'une macro pour récupérer
le code, mais je trouve qu'il est un peu long...
y a t-il un moyen pour raccoursisr ce code ?
(quand clik sur bouton, de B11:B15 cases sont
barrées en diagonales)
merci du tuyau
Sub Macro5()
Range("B11:C15").Select
With Selection.Borders(xlDiagonalDown)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlDiagonalUp)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideHorizontal).LineStyle > xlNone
End Sub
Salut Michel, Voilà : Sub Macro5() Dim I As Integer For I = 5 To 10 With [B11:C15].Borders(I) .LineStyle = 1 .Weight = -4138 End With Next I End Sub
Hervé.
"Michel.P" a écrit dans le message de news:
Bonjour à toutes et à tous J'ai lancé la création d'une macro pour récupérer le code, mais je trouve qu'il est un peu long... y a t-il un moyen pour raccoursisr ce code ? (quand clik sur bouton, de B11:B15 cases sont barrées en diagonales)
merci du tuyau
Sub Macro5() Range("B11:C15").Select With Selection.Borders(xlDiagonalDown) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlDiagonalUp) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With
Selection.Borders(xlInsideHorizontal).LineStyle > xlNone End Sub
-- Amicalement Michel . P
Michel.P
Merci à vous deux, je prends le tout et v'ai exploiter tout ça.. bon week end
-- Amicalement Michel . P
Merci à vous deux, je prends le tout et v'ai
exploiter tout ça..
bon week end