Je sais le faire de bas en haut (End(xlUp)) mais je le fais ainsi parce que j'ai un autre tableau qui m'enpêche d'utiliser la deuxième façon.
Une solution ?
Merci d'avance.
Apitos
Bonjour LSteph,
Ca marche.
Et voila le code que j'utilise :
'-- Définition des plages 'reDébit', 'reDébit_Date' et 'reDébit_Nom s' dans le tableau re-Débit With [I2] If Len(.Offset(1, 0)) > 0 Then Range("I2:I" & .End(xlDown).Row).Name = "reDébit" Range("K2:K" & [K2].End(xlDown).Row).Name = "reDébit_Date" Range("J2:J" & [J2].End(xlDown).Row).Name = "reDébit_Noms" Else .Name = "reDébit" [K2].Name = "reDébit_Date" [J2].Name = "reDébit_Noms" End If End With
Merci.
Bonjour LSteph,
Ca marche.
Et voila le code que j'utilise :
'-- Définition des plages 'reDébit', 'reDébit_Date' et 'reDébit_Nom s' dans le tableau re-Débit
With [I2]
If Len(.Offset(1, 0)) > 0 Then
Range("I2:I" & .End(xlDown).Row).Name = "reDébit"
Range("K2:K" & [K2].End(xlDown).Row).Name = "reDébit_Date"
Range("J2:J" & [J2].End(xlDown).Row).Name = "reDébit_Noms"
Else
.Name = "reDébit"
[K2].Name = "reDébit_Date"
[J2].Name = "reDébit_Noms"
End If
End With
'-- Définition des plages 'reDébit', 'reDébit_Date' et 'reDébit_Nom s' dans le tableau re-Débit With [I2] If Len(.Offset(1, 0)) > 0 Then Range("I2:I" & .End(xlDown).Row).Name = "reDébit" Range("K2:K" & [K2].End(xlDown).Row).Name = "reDébit_Date" Range("J2:J" & [J2].End(xlDown).Row).Name = "reDébit_Noms" Else .Name = "reDébit" [K2].Name = "reDébit_Date" [J2].Name = "reDébit_Noms" End If End With
Merci.
LSteph
Dim mTab(), x As Long mTab = Array("reDébit", "reDébit_Date", "reDébit_Noms")
For x = 1 To [I2:k2].Cells.Count
With [I2:k2].Cells(x) If Len(.Offset(1, 0)) > 0 Then Range(.Address, .End(xlDown).Address).Name = mTab(x - 1) Else .Name = mTab(x - 1) End If End With Next
'LSteph ;-)
Dim mTab(), x As Long
mTab = Array("reDébit", "reDébit_Date", "reDébit_Noms")
For x = 1 To [I2:k2].Cells.Count
With [I2:k2].Cells(x)
If Len(.Offset(1, 0)) > 0 Then
Range(.Address, .End(xlDown).Address).Name = mTab(x - 1)
Else
.Name = mTab(x - 1)
End If
End With
Next
Dim mTab(), x As Long mTab = Array("reDébit", "reDébit_Date", "reDébit_Noms")
For x = 1 To [I2:k2].Cells.Count
With [I2:k2].Cells(x) If Len(.Offset(1, 0)) > 0 Then Range(.Address, .End(xlDown).Address).Name = mTab(x - 1) Else .Name = mTab(x - 1) End If End With Next
'LSteph ;-)
Apitos
Bonjour LSteph,
Et pour ce code, peut-on le reduire ?
'-- Définition des plages 'Débit' et 'Débit_Date' dans le tableau D ébit Dim dbTab(), x As Long dbTab = Array("Débit", "Débit_Date", "Débit_Noms") For x = 1 To [A2:C2].Cells.Count With [A2:C2].Cells(x) If Len(.Offset(1, 0)) > 0 Then Range(.Address, .End(xlDown).Address).Name = dbTab(x - 1) Else .Name = dbTab(x - 1) End If End With Next
'-- Définition des plages 'reDébit', 'reDébit_Date' et 'reDébit_Nom s' dans le tableau re-Débit Dim re_dbTab() re_dbTab = Array("reDébit", "reDébit_Date", "reDébit_Noms")
For x = 1 To [I2:k2].Cells.Count With [I2:k2].Cells(x) If Len(.Offset(1, 0)) > 0 Then Range(.Address, .End(xlDown).Address).Name = re_dbTab(x - 1) Else .Name = re_dbTab(x - 1) End If End With Next
Merci
Bonjour LSteph,
Et pour ce code, peut-on le reduire ?
'-- Définition des plages 'Débit' et 'Débit_Date' dans le tableau D ébit
Dim dbTab(), x As Long
dbTab = Array("Débit", "Débit_Date", "Débit_Noms")
For x = 1 To [A2:C2].Cells.Count
With [A2:C2].Cells(x)
If Len(.Offset(1, 0)) > 0 Then
Range(.Address, .End(xlDown).Address).Name = dbTab(x - 1)
Else
.Name = dbTab(x - 1)
End If
End With
Next
'-- Définition des plages 'reDébit', 'reDébit_Date' et 'reDébit_Nom s' dans le tableau re-Débit
Dim re_dbTab()
re_dbTab = Array("reDébit", "reDébit_Date", "reDébit_Noms")
For x = 1 To [I2:k2].Cells.Count
With [I2:k2].Cells(x)
If Len(.Offset(1, 0)) > 0 Then
Range(.Address, .End(xlDown).Address).Name = re_dbTab(x - 1)
Else
.Name = re_dbTab(x - 1)
End If
End With
Next
'-- Définition des plages 'Débit' et 'Débit_Date' dans le tableau D ébit Dim dbTab(), x As Long dbTab = Array("Débit", "Débit_Date", "Débit_Noms") For x = 1 To [A2:C2].Cells.Count With [A2:C2].Cells(x) If Len(.Offset(1, 0)) > 0 Then Range(.Address, .End(xlDown).Address).Name = dbTab(x - 1) Else .Name = dbTab(x - 1) End If End With Next
'-- Définition des plages 'reDébit', 'reDébit_Date' et 'reDébit_Nom s' dans le tableau re-Débit Dim re_dbTab() re_dbTab = Array("reDébit", "reDébit_Date", "reDébit_Noms")
For x = 1 To [I2:k2].Cells.Count With [I2:k2].Cells(x) If Len(.Offset(1, 0)) > 0 Then Range(.Address, .End(xlDown).Address).Name = re_dbTab(x - 1) Else .Name = re_dbTab(x - 1) End If End With Next
Merci
gmlsteph
Bonjour,
Dim dbTab(), c As Range, myPlg As Range, x As Long dbTab = Array("Débit", "Débit_Date", "Débit_Noms", "reDébit", "re Débit_Date", "reDébit_Noms") Set myPlg = Union([A2:C2], [I2:k2]) x = 0 For Each c In myPlg.Cells If Len(c.Offset(1, 0)) > 0 Then Range(c.Address, c.End(xlDown).Address).Name = dbTab(x) Else c.Name = dbTab(x) End If
x = x + 1 Next Set myPlg = Nothing
'LSteph
Le vendredi 13 avril 2012 14:07:33 UTC+2, Apitos a écrit :
Bonjour LSteph,
Et pour ce code, peut-on le reduire ?
'-- Définition des plages 'Débit' et 'Débit_Date' dans le tableau D ébit Dim dbTab(), x As Long dbTab = Array("Débit", "Débit_Date", "Débit_Noms") For x = 1 To [A2:C2].Cells.Count With [A2:C2].Cells(x) If Len(.Offset(1, 0)) > 0 Then Range(.Address, .End(xlDown).Address).Name = dbTab(x - 1) Else .Name = dbTab(x - 1) End If End With Next
'-- Définition des plages 'reDébit', 'reDébit_Date' et 'reDébit_N oms' dans le tableau re-Débit Dim re_dbTab() re_dbTab = Array("reDébit", "reDébit_Date", "reDébit_Noms")
For x = 1 To [I2:k2].Cells.Count With [I2:k2].Cells(x) If Len(.Offset(1, 0)) > 0 Then Range(.Address, .End(xlDown).Address).Name = re_dbTab(x - 1 ) Else .Name = re_dbTab(x - 1) End If End With Next
Merci
Bonjour,
Dim dbTab(), c As Range, myPlg As Range, x As Long
dbTab = Array("Débit", "Débit_Date", "Débit_Noms", "reDébit", "re Débit_Date", "reDébit_Noms")
Set myPlg = Union([A2:C2], [I2:k2])
x = 0
For Each c In myPlg.Cells
If Len(c.Offset(1, 0)) > 0 Then
Range(c.Address, c.End(xlDown).Address).Name = dbTab(x)
Else
c.Name = dbTab(x)
End If
x = x + 1
Next
Set myPlg = Nothing
'LSteph
Le vendredi 13 avril 2012 14:07:33 UTC+2, Apitos a écrit :
Bonjour LSteph,
Et pour ce code, peut-on le reduire ?
'-- Définition des plages 'Débit' et 'Débit_Date' dans le tableau D ébit
Dim dbTab(), x As Long
dbTab = Array("Débit", "Débit_Date", "Débit_Noms")
For x = 1 To [A2:C2].Cells.Count
With [A2:C2].Cells(x)
If Len(.Offset(1, 0)) > 0 Then
Range(.Address, .End(xlDown).Address).Name = dbTab(x - 1)
Else
.Name = dbTab(x - 1)
End If
End With
Next
'-- Définition des plages 'reDébit', 'reDébit_Date' et 'reDébit_N oms' dans le tableau re-Débit
Dim re_dbTab()
re_dbTab = Array("reDébit", "reDébit_Date", "reDébit_Noms")
For x = 1 To [I2:k2].Cells.Count
With [I2:k2].Cells(x)
If Len(.Offset(1, 0)) > 0 Then
Range(.Address, .End(xlDown).Address).Name = re_dbTab(x - 1 )
Else
.Name = re_dbTab(x - 1)
End If
End With
Next
Dim dbTab(), c As Range, myPlg As Range, x As Long dbTab = Array("Débit", "Débit_Date", "Débit_Noms", "reDébit", "re Débit_Date", "reDébit_Noms") Set myPlg = Union([A2:C2], [I2:k2]) x = 0 For Each c In myPlg.Cells If Len(c.Offset(1, 0)) > 0 Then Range(c.Address, c.End(xlDown).Address).Name = dbTab(x) Else c.Name = dbTab(x) End If
x = x + 1 Next Set myPlg = Nothing
'LSteph
Le vendredi 13 avril 2012 14:07:33 UTC+2, Apitos a écrit :
Bonjour LSteph,
Et pour ce code, peut-on le reduire ?
'-- Définition des plages 'Débit' et 'Débit_Date' dans le tableau D ébit Dim dbTab(), x As Long dbTab = Array("Débit", "Débit_Date", "Débit_Noms") For x = 1 To [A2:C2].Cells.Count With [A2:C2].Cells(x) If Len(.Offset(1, 0)) > 0 Then Range(.Address, .End(xlDown).Address).Name = dbTab(x - 1) Else .Name = dbTab(x - 1) End If End With Next
'-- Définition des plages 'reDébit', 'reDébit_Date' et 'reDébit_N oms' dans le tableau re-Débit Dim re_dbTab() re_dbTab = Array("reDébit", "reDébit_Date", "reDébit_Noms")
For x = 1 To [I2:k2].Cells.Count With [I2:k2].Cells(x) If Len(.Offset(1, 0)) > 0 Then Range(.Address, .End(xlDown).Address).Name = re_dbTab(x - 1 ) Else .Name = re_dbTab(x - 1) End If End With Next