How can I write a vba to delete all x lables for all charts in the spreadsheet? -


i have 7 stacked column charts in 1 tab. want write vba remove vertical labels on left hand side in charts. thought simple it's not!

so want "delete x labels" or "remove vertical labels on left hand side"? reads though first referring horizontal x-axis , vertical y-axis - bit confusing. helps if use excel terminology - vertical or horizontal axis. , remove axis, axis title or axis tick labels?

that aside... can loop through chart objects in worksheet this:

sub loopcharts()  dim integer  = 1 activesheet.chartobjects.count      'do stuff chart  next    end sub 

for example, if want delete vertical axis:

sub delvertaxisallcharts()  dim integer  = 1 activesheet.chartobjects.count      activesheet.chartobjects(i).chart.axes(xlvalue).delete  next    end sub 

if want remove horizontal tick labels:

sub remhorizticklabels()  dim integer  = 1 activesheet.chartobjects.count      activesheet.chartobjects(i).chart.axes(xlcategory).ticklabelposition = xlnone  next    end sub 

hope helps...


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -