E
Eric
Hello,
I am looking for a way to mirror a value from one sheet to another, in the
same workbook. I currently have a table with a named range of values
"vUtilityUsage_Basic". I want those values to be updated from a certain table
depending on the value of a drop down list called "vUtility_Company". Here is
what I got, can someone help me correct this?
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ErrH:
Application.EnableEvents = False
Select Case LCase(Me.Range("vUtility_Company").Value)
Case LCase("PGE Residential")
Call PGE_Res_WriteUsage
Case LCase("PGE Business")
Call PGE_Bus_WriteUsage
Case LCase("SMUD Residential")
Call SMUD_Res_WriteUsage
Case Else
'do nothing, just continue to the end sub
End Select
ErrH:
Application.EnableEvents = True
End Sub
Sub PGE_Res_WriteUsage()
Me.Range("vPGE_Res_E1Usage") = Target.Value
End Sub
Sub PGE_Bus_WriteUsage()
Me.Range("vPGE_Bus_A1Usage") = Target.Value
End Sub
Sub SMUD_Res_WriteUsage()
Me.Range("vSMUD_Res_Usage") = Target.Value
End Sub
I am looking for a way to mirror a value from one sheet to another, in the
same workbook. I currently have a table with a named range of values
"vUtilityUsage_Basic". I want those values to be updated from a certain table
depending on the value of a drop down list called "vUtility_Company". Here is
what I got, can someone help me correct this?
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ErrH:
Application.EnableEvents = False
Select Case LCase(Me.Range("vUtility_Company").Value)
Case LCase("PGE Residential")
Call PGE_Res_WriteUsage
Case LCase("PGE Business")
Call PGE_Bus_WriteUsage
Case LCase("SMUD Residential")
Call SMUD_Res_WriteUsage
Case Else
'do nothing, just continue to the end sub
End Select
ErrH:
Application.EnableEvents = True
End Sub
Sub PGE_Res_WriteUsage()
Me.Range("vPGE_Res_E1Usage") = Target.Value
End Sub
Sub PGE_Bus_WriteUsage()
Me.Range("vPGE_Bus_A1Usage") = Target.Value
End Sub
Sub SMUD_Res_WriteUsage()
Me.Range("vSMUD_Res_Usage") = Target.Value
End Sub