Ramo964516
03-01-2016, 02:19 PM
i'm working on a macro, and i use `resize` to select a range. Wich range i use in `autofill`. the original adress of `strPlageNumSemaines` is `AB5`. I don't know why it's still has `AB5` address even after the resize. Here is my code:
Dim strDernierJourDuMois As String
Dim strPlageNumSemaines As String
count = 0
strPlageNumSemaines = Range(strDernierJourDuMois).Offset(0, 1).Address
strPlageNumSemaines = Range(strPlageNumSemaines).Resize(1, count)
If dbNbSemaines = 4 Then
count = 4
ElseIf dbNbSemaines = 5 Then
count = 5
End If
Range("E5:AE5").Find(dtDernierJourDuMois, Range("E5")).Offset(0, 1).Select
Selection.AutoFill Destination:=Range(strPlageNumSemaines),Type:=xlFillDefault
Dim strDernierJourDuMois As String
Dim strPlageNumSemaines As String
count = 0
strPlageNumSemaines = Range(strDernierJourDuMois).Offset(0, 1).Address
strPlageNumSemaines = Range(strPlageNumSemaines).Resize(1, count)
If dbNbSemaines = 4 Then
count = 4
ElseIf dbNbSemaines = 5 Then
count = 5
End If
Range("E5:AE5").Find(dtDernierJourDuMois, Range("E5")).Offset(0, 1).Select
Selection.AutoFill Destination:=Range(strPlageNumSemaines),Type:=xlFillDefault