1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Sub MaJ_LibelleTCD()
Dim strSource As String, strFeuille As String, strPlage As String
Dim sh As Worksheet, rng As Range
strSource = Worksheets("TCD").PivotTables("TCD").SourceData
strFeuille = Left(strSource, InStr(strSource, "!") - 1)
strPlage = Replace(Right(strSource, Len(strSource) - _
InStr(strSource, "!")), "L", "R")
strSource = Application.ConvertFormula(Formula:=strFeuille & "!" & _
strPlage, fromReferenceStyle:=xlR1C1, _
toReferenceStyle:=xlA1, toAbsolute:=xlAbsolute)
strPlage = Right(strSource, Len(strSource) - InStr(strSource, "!"))
Set sh = ActiveWorkbook.Worksheets(strFeuille)
Set rng = sh.Range(strPlage)
...
End Sub |
Partager