Рет қаралды 3,950
How to line up charts in excel with a macro
Sub AlignCharts()
Dim shp As Shape
Dim Cnt As Long
Dim dTop As Double
Dim dLeft As Double
Dim dHeight As Double
Dim dWidth As Double
Dim start As Double
Const ColCnt As Long = 3
Cnt = 1
For Each shp In Selection.ShapeRange
With shp
If Cnt = 1 Then
start = .Left
Else
If Cnt Mod ColCnt = 1 Then
.Top = dTop + dHeight
.Left = start
Else
.Top = dTop
.Left = dLeft + dWidth
End If
End If
dTop = .Top
dLeft = .Left
dHeight = .Height
dWidth = .Width
End With
Cnt = Cnt + 1
Next shp
End Sub
Where the code comes from:
• Vba Macro: How To Layo...
www.excelcampu...
---------------------------------------------------------------------------------
#exceltutorials #excelvba #excelcharts
SUBSCRIBE: goo.gl/c46YPs
Microsoft Office 365, 2016, Office Insider, Version 1909
These data are related to my PhD research
---------------------------------------------------------------------------------
IF YOU LIKED THIS VIDEO YOU MAY ALSO LIKE:
How to make multiple charts using vba in excel • How to make multiple c...
How to quickly make multiple charts in excel • How to quickly make mu...
How to make panel charts in excel - method 1 • How to make panel char...