Hi all,
I've created a report which can be run at different levels, i.e. countywide and for each of 3 different regions.
Part of the report is a trend analysis which will show one of 4 graphs of trend information.
As i'm very inexperianced with VBA, i'm probably not going about this the right way, however here is my position.
I have all 4 charts placed one on top of the other within my workbook and have the following code to bring the relevant chart to the front, based on a field within the worksheet.
For instance when the check field = "Countywide" chart 3 will be bought to the front. check field = "Northern" chart 7 will be bought to the front and so on.
Here is my code, which appears to be doing nothing.
You guys and girls will no doubt spot the problem straight away, so thanks in advance for your help!
Cheers
I've created a report which can be run at different levels, i.e. countywide and for each of 3 different regions.
Part of the report is a trend analysis which will show one of 4 graphs of trend information.
As i'm very inexperianced with VBA, i'm probably not going about this the right way, however here is my position.
I have all 4 charts placed one on top of the other within my workbook and have the following code to bring the relevant chart to the front, based on a field within the worksheet.
For instance when the check field = "Countywide" chart 3 will be bought to the front. check field = "Northern" chart 7 will be bought to the front and so on.
Here is my code, which appears to be doing nothing.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Check As String
Check = R4C16
If Check = "Countywide" Then
ActiveSheet.Shapes("Chart 3").Select
Selection.ShapeRange.ZOrder msoBringToFront
If Check = "Eastern" Then
ActiveSheet.Shapes("Chart 6").Select
Selection.ShapeRange.ZOrder msoBringToFront
If Check = "Southern" Then
ActiveSheet.Shapes("Chart 8").Select
Selection.ShapeRange.ZOrder msoBringToFront
If Check = "Northern" Then
ActiveSheet.Shapes("Chart 7").Select
Selection.ShapeRange.ZOrder msoBringToFront
End If
End If
End If
End If
End Sub
You guys and girls will no doubt spot the problem straight away, so thanks in advance for your help!
Cheers