I am not an excel expert and need guidance.
I have made some graphs in one sheet and when I update the cell value in other sheet the graph is changing automatically. but i want to show the value for each day in the graph bar chart. I don't want to show the "0" value for future days. I was unable to run the macro automatically and only when i press run macro it is executing.
Below code taken from web and when I use this it asks for select the chart first. If is select it is running.
The code to run in my sheet chart 7 automatically when I update the cell values
Thanks in advance.
I have made some graphs in one sheet and when I update the cell value in other sheet the graph is changing automatically. but i want to show the value for each day in the graph bar chart. I don't want to show the "0" value for future days. I was unable to run the macro automatically and only when i press run macro it is executing.
Below code taken from web and when I use this it asks for select the chart first. If is select it is running.
The code to run in my sheet chart 7 automatically when I update the cell values
Code:
Sub Show_Labels_Greater_Than_Zero()
Dim srs As Series, i As Long, cht As Chart
On Error Resume Next
Set cht = ActiveChart
On Error GoTo 0
If cht Is Nothing Then
MsgBox "Please select a chart first.", vbInformation, "No Chart Selected"
Else
For Each srs In cht.SeriesCollection
For i = 1 To UBound(srs.Values)
srs.Points(i).HasDataLabel = srs.Values(i) > 0
Next i
Next srs
End If
End Sub