Hi,
I have 2 drop down lists in 2 separate sheets, which have the same list associated with it. Question I'm looking for the answer for is in bold below?
So, if I change the value on one sheet, I want it to link to the other sheet and change..
I have the following code in the first sheet (Dashboard - The main sheet) The code setting the value equal to the other value is in between the Application.ScreenUpdating lines:
So, this obviously runs a little bit more code after it, which is needed for some other things
Then, I have this in the other sheet:
The only thing this does is set the value as the same on the Dashboard and activates this sheet again. The reason I have the activate line in there is because it runs the Worksheet_Change on the Dashboard when this changes (obviously!)
So, what happens is that it still changes sheets and back again when I change either value...it's not the end of the world, but can anyone tell me why is it showing the sheet changing when I have application.ScreenUpdating set to False?
If I'm not clear, please let me know!
Thanks,
Eoin
I have 2 drop down lists in 2 separate sheets, which have the same list associated with it. Question I'm looking for the answer for is in bold below?
So, if I change the value on one sheet, I want it to link to the other sheet and change..
I have the following code in the first sheet (Dashboard - The main sheet) The code setting the value equal to the other value is in between the Application.ScreenUpdating lines:
Code:
Private Sub Worksheet_Change(ByVal Target As Range) Set TrendA = Sheets("Trend Analysis")
Application.ScreenUpdating = False
If (TrendA.Range("E2") <> Range("E4").Value) Then
TrendA.Range("E2") = Range("E4").Value
End If
Application.ScreenUpdating = True
If Range("BM48") = 1 Then
MsgBox " Please enter either % OR Value.", vbExclamation, "Avg Inc."
Range("BG48:BL48").ClearContents
Range("BG48").Select
End If
FormatGraph ("Front")
End Sub
So, this obviously runs a little bit more code after it, which is needed for some other things
Then, I have this in the other sheet:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Set Dashb = Sheets("Dashboard")
Set TrendA = Sheets("Trend Analysis")
Application.ScreenUpdating = False
If (Dashb.Range("E4") <> TrendA.Range("E2").Value) Then
Dashb.Range("E4") = TrendA.Range("E2").Value
End If
TrendA.Activate
Application.ScreenUpdating = True
End Sub
The only thing this does is set the value as the same on the Dashboard and activates this sheet again. The reason I have the activate line in there is because it runs the Worksheet_Change on the Dashboard when this changes (obviously!)
So, what happens is that it still changes sheets and back again when I change either value...it's not the end of the world, but can anyone tell me why is it showing the sheet changing when I have application.ScreenUpdating set to False?
If I'm not clear, please let me know!
Thanks,
Eoin