Hiding Rows and Columns in a linked graph automatically

  • Thread starter Thread starter Ailish O'Connor
  • Start date Start date
A

Ailish O'Connor

Hi

It is possible to hide rows and column in a graph in Powerpoint
through VBA code. I have managed to get the graphs to update
automatically through VBA code but I now need to automate hiding
certain rows and columns on the datasheet.

Thanks
Ailish
 
Ailish O'Connor said:
Hi

It is possible to hide rows and column in a graph in Powerpoint
through VBA code. I have managed to get the graphs to update
automatically through VBA code but I now need to automate hiding
certain rows and columns on the datasheet.


' With a reference set to MS Graph for early binding:
'Dim oChart As Graph.Chart
'Dim oSheet As Graph.DataSheet

' or without, for late binding:
Dim oChart As Graph.Chart
Dim oSheet As Graph.DataSheet

Set oChart = ActiveWindow.Selection.ShapeRange(1).OLEFormat.Object
Set oSheet = oChart.Application.DataSheet

With oSheet
' Disable the first row and column of data
' The first row in the datasheet contains labels, so offset by 1
.Rows(2).Include = False
.Columns(2).Include = False
End With
 
Back
Top