my chart disappear when I try to update my x-axis min and max scale

daniboymu

Board Regular
Joined
Nov 1, 2020
Messages
54
Office Version
  1. 2019
Platform
  1. Windows
I have a problem with my chart, when I update the period of the chart and updates the mininum and maximun X-axis scale my chart disappear, what can i do about that?
IF SOMEONE COULD FIX THE CODE PLEASE!

VBA Code:
Sub ESCALADA()

Dim name As String
  
Application.ScreenUpdating = False
  
ActiveSheet.ChartObjects("Gráfico 5").Activate
ActiveChart.Axes(xlCategory, 1).Select
    
With ActiveChart.Axes(xlCategory, 1)
'.Crosses = xlMinimum
.CategoryType = xlTimeScale
.MajorUnit = Range("J7").Value
'.BaseUnitIsAuto = True
.MinimumScale = Range("H7").Value
.MaximumScale = Range("I7").Value
.TickLabels.Orientation = 45
.ReversePlotOrder = True
Application.ScreenUpdating = True
End With
End Sub
 

Attachments

  • 1.png
    1.png
    136.1 KB · Views: 17
  • 2.png
    2.png
    76 KB · Views: 17

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Have a look at this thread:
 
Upvote 0

Forum statistics

Threads
1,215,734
Messages
6,126,543
Members
449,316
Latest member
sravya

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top