Link chart axis maximum and minimum to cells | Excel

preview_player
Показать описание
Change start date and end date of x axis using vba

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$E$2" Then
ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlCategory).MinimumScale = Range("E2").Value
End If

If Target.Address = "$J$2" Then
ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlCategory).MaximumScale = Range("J2").Value
End If

End Sub

---------------------------------------------------------------------------------
#exceltutorials #excelcharts #excelvba

Microsoft Office 365, Beta Channel, Version 2201
---------------------------------------------------------------------------------
IF YOU LIKED THIS VIDEO YOU MAY ALSO LIKE:
Рекомендации по теме
Комментарии
Автор

Great video, straight to the point, easy to hear your voice, and you explain what you're doing at each step of the way. Also, bonus points for the well-titled video making it show up well in google searches.

matt
Автор

In just one video, you showed me how to use selection and make chart axis dynamic. Amazing! Thank you so much for this video.

carvingsonthewall
Автор

You are AMAZING! Very skilled and knowledgeable.

NancyMancarious
Автор

Great tutorial. Worked perfectly and so well explained. Thank you

sashh
Автор

Excellent video, very well explained. Clear and accurate. Thank-you!

Zeuswigglybum
Автор

Excellent Thanks a lot ! This has been a major issue for several years and now it appears to have be solved !

rajnajat
Автор

Awesome training. This was exactly what I was looking for. I'll use max/min of another linked pivot with some padding and bingo!

aa
Автор

Very well explained. Thank you and YouTube that I learn everyday something new in excel

happylearning-gp
Автор

Best tutorial I've seen, thank you!

JC-jfbi
Автор

Thenk you very much for this tutorial. Very well explained!

juanfe
Автор

Thanks so much for sharing this tutorial!

lawrenceliew
Автор

Great video i never knew i would need, thank you

IGRA
Автор

Fantastic, thanks Karina. I thought one could then use a spin button to change the max and min values on the sheet, making adjustment of the axes really quick and easy, but it seems that it does not work because using the spin button to change the value of the cell does not register the change as required to trigger the subroutine :-(

garethfloweday
Автор

Thanks so much for the video (explanation).👍👍👍

argowuryanto
Автор

Hi. In the Syntax "Axes(xlCategory)" in your video, I get the same as "Axes(xlValue)". And another issue is the dates are not changing automatically. I have to run the macro everytime. Kindly suggest

sreaedhar
Автор

Hi! Your video is perfect! I have one only problem I could not fix with your tip... when I change X range, the Y axle does not change range automatically, even with "automatic" option selected. Y axle still keeps the range for all data set, and not for the range select (range that is being viewed). Any suggestion? Thanks!

fhabiano
Автор

I have done exactly as outlined in the video but the automatic change is erratic to say the least, and sometimes doesn't occur at all. Any suggestions?

johnmcphee
Автор

I have my chart in its own separate sheet - how can I edit the code to accommodate this? Great video thank you

milesbaker
Автор

Thanks I love it. one question, I want to Protect that Sheet because I have slicers to change the axis, but once I protect the sheet a message about debug appear. do you know how to solve it?

Автор

My code is not running automatically. I’m still having to click macro and run macro but I pasted the code worksheet under the change option as instructed?

KatieTaylor-kr
join shbcf.ru