Boostez vos compétences Excel avec notre communauté !
Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !
Set ref = Application.Caller
[B]If ref.MergeCells = True Then Set ref = Range(ref.MergeArea.Address)[/B]
Function HistoChart(Points As Range, Optional ByVal Couleur% = 29[B][COLOR="Red"], Optional Maplage As Range = Nothing[/COLOR][/B])
'Ti pour XLD
Const KMg = 2, KTag = "Hist"
Dim Ref As Range, ShRg(), Bcle&, Cnt&
Dim Pts, Lg#, Ht#, Rp#
On Error Resume Next
With Points
If .Rows.Count > 1 And .Columns.Count > 1 Then
HistoChart = CVErr(xlErrValue): Exit Function
End If
Pts = .Value: Cnt = .Count
ReDim ShRg(1 To Cnt)
If .Columns.Count > 1 Then Pts = WorksheetFunction.Transpose(Pts)
End With
[COLOR="red"][B] If Not Maplage Is Nothing Then Set Ref = Maplage Else Set Ref = Application.Caller
If Ref.MergeCells Then Set Ref = Range(Ref.MergeArea.Address) ' Sur cellule fusionnée[/B][/COLOR]
With Ref
.Worksheet.Shapes(KTag & .Address).Delete
Lg = (.Width - (KMg * (Cnt + 1))) / Cnt
Rp = WorksheetFunction.Max(Pts) / (.Height - (KMg * 2))
For Bcle = 1 To Cnt
Ht = Pts(Bcle, 1) / Rp
With .Worksheet.Shapes.AddShape(msoShapeRectangle, _
.Left + (KMg * Bcle + Lg * (Bcle - 1)), _
.Top + .Height - Ht - KMg, Lg, Ht)
ShRg(Bcle) = .Name
End With
Next Bcle
With .Worksheet.Shapes.Range(ShRg)
.Group
.Fill.ForeColor.SchemeColor = Couleur
.Name = KTag & Ref.Address
End With
End With
HistoChart = ""
End Function
Min = WorksheetFunction.Min(Pts)
Max = WorksheetFunction.Max(Pts)
If Abs(Min) > Abs(Echelle_mini) Or Abs(Max) > Abs(Echelle_maxi) Then
LineChart3 = "#Echelle"
Exit Function
End If
Function LineChart3(Points As Range, Echelle_mini As [COLOR="red"][B]Double[/B][/COLOR], Echelle_maxi As [B][COLOR="Red"]Double[/COLOR][/B], Optional ByVal Axe = 1, Optional ByVal Couleur% = 2, Optional Maplage As Range = Nothing)
We use cookies and similar technologies for the following purposes:
Est ce que vous acceptez les cookies et ces technologies?
We use cookies and similar technologies for the following purposes:
Est ce que vous acceptez les cookies et ces technologies?