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

daniboymu

New Member
Joined
Nov 1, 2020
Messages
44
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: 4
  • 2.png
    2.png
    76 KB · Views: 3

Some videos you may like

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

sijpie

Well-known Member
Joined
Nov 1, 2008
Messages
3,734
Have a look at this thread:
 

Watch MrExcel Video

Forum statistics

Threads
1,127,191
Messages
5,623,291
Members
415,963
Latest member
PatrickDurning

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
Top