J
jack
Excel 2003
I have 50 sales regions on a map with 50 autoshapes for each region on sheet
2.
On sheet 1, there's a column listing of the regions and a corresponding
column C7:C57 that's to be filled in when each region reaches its goal. On
sheet 2, there's a table listing the regions and the corresponding auto
shape numbers in C71:C121
What I want to do is change the specific autoshape from red to green on the
region map as each region reaches its goal.
What I think I need is some code based on a change on sheet 1 to modify the
color of specific autoshape on sheet 2. However, I can't seem to get it to
work .
Here's what I have been working with but not succeeding.
Any guidance would be appreciated. as I don't think I have the proper coding
to use the autoshapes.
Private Sub Worksheet_Change(ByVal Target As Range)
'Change Smiley face Red / Green depending if "X" is in goal cell for region
'Dim i, j As Long
' Application.ScreenUpdating = False
'Worksheets("Sheet2").Unprotect
For i = 7 To 57
For j = 71 To 121
If Worksheets("Sheet1").Range("C" & i) = "" Then
ActiveSheet.Shapes("AutoShape 3").Select 'NEED TO CHANGE TO SELECT
EACH SHAPE
Call toRed
Else
'ActiveSheet.Shapes("Worksheets.("sheet2").range("C" &
j("AutoShape 3").Select
'Worksheets("sheet2").range("C & j).shapes("Autoshape 3").select
Call toGreen
End If
Next j
Next i
' Worksheets("sheet1").Protect DrawingObjects:=False, Contents:=True,
Scenarios:= _
' True, AllowFormattingCells:=True, AllowSorting:=True
' Application.ScreenUpdating = True
End Sub
I have 50 sales regions on a map with 50 autoshapes for each region on sheet
2.
On sheet 1, there's a column listing of the regions and a corresponding
column C7:C57 that's to be filled in when each region reaches its goal. On
sheet 2, there's a table listing the regions and the corresponding auto
shape numbers in C71:C121
What I want to do is change the specific autoshape from red to green on the
region map as each region reaches its goal.
What I think I need is some code based on a change on sheet 1 to modify the
color of specific autoshape on sheet 2. However, I can't seem to get it to
work .
Here's what I have been working with but not succeeding.
Any guidance would be appreciated. as I don't think I have the proper coding
to use the autoshapes.
Private Sub Worksheet_Change(ByVal Target As Range)
'Change Smiley face Red / Green depending if "X" is in goal cell for region
'Dim i, j As Long
' Application.ScreenUpdating = False
'Worksheets("Sheet2").Unprotect
For i = 7 To 57
For j = 71 To 121
If Worksheets("Sheet1").Range("C" & i) = "" Then
ActiveSheet.Shapes("AutoShape 3").Select 'NEED TO CHANGE TO SELECT
EACH SHAPE
Call toRed
Else
'ActiveSheet.Shapes("Worksheets.("sheet2").range("C" &
j("AutoShape 3").Select
'Worksheets("sheet2").range("C & j).shapes("Autoshape 3").select
Call toGreen
End If
Next j
Next i
' Worksheets("sheet1").Protect DrawingObjects:=False, Contents:=True,
Scenarios:= _
' True, AllowFormattingCells:=True, AllowSorting:=True
' Application.ScreenUpdating = True
End Sub