HoboEconomist
New Member
- Joined
- May 6, 2020
- Messages
- 5
- Office Version
- 2016
- Platform
- Windows
I'm trying to create a macro where a user can select multiple charts on a worksheet, and then upon running the macro, enter the desired Min, Max, and Major Unit values for the Y-Axes for the selected charts. All charts would have the same Y-Axes.
I found the following code snippet to loop through all selected charts, but am struggling with the userform / input macro which the code snippet would call. Could someone please point me in the right direction?
I found the following code snippet to loop through all selected charts, but am struggling with the userform / input macro which the code snippet would call. Could someone please point me in the right direction?
VBA Code:
Dim obj As Object
'Check if any charts have been selected
If Not ActiveChart Is Nothing Then
Call AnotherMacro(ActiveChart)
Else
For Each obj In Selection
'If more than one chart selected
If TypeName(obj) = "ChartObject" Then
Call AnotherMacro(obj.Chart)
End If
Next
End If