Bonjour Nychko, José, le Forum
En fait si tu n'a besoin que du Format de "NumberFormat" la solution de mon ami José est largement suffisante.
Par contre, là où ça va se corser c'est si tu veux appliquer différents formats d'un coup... Donc je propose une autre approche...
Voici un exemple basé sur "PasteSpecial" avec la constante "xlPasteFormats" ce qui a pour avantage de ne pas à avoir à mémoriser toutes les possibilités de format (Font, Interior, Border, NumberFormat, etc etc etc)
Option Explicit
Public CellSourceFormat As Range
Sub CopyFormat()
Set CellSourceFormat = ActiveCell
End Sub
Sub ApplyFormat()
Dim i As Byte
If CellSourceFormat Is Nothing Then Exit Sub
CellSourceFormat.Copy
For i = 1 To 20 Step 2
Cells(i, 1).PasteSpecial Paste:=xlPasteFormats
Next
Application.CutCopyMode = False
End Sub
Explication :
La Macro "CopyFormat" charge en mémoire l'objet range de la cellule active, en utilisant la Variable Public "CellSourceFormat "...
La Macro "ApplyFormat" va appliquer sur les cellules A1, A3, A5, A7, A9, A11, A13, A15, A17, A19 le même format...
Si la Variable "CellSourceFormat " est vide (macro "CopyFormat" n'ayant pas tournée au préalable), une condition stop la procédure...
Je ne sais pas si c'est ce que tu cherches, mais c'est un moyen.
Bon Aprèm
@+Thierry