Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
mirror table depending on cell value
Hello,
Here is my current non-working Code: 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(ByVal Target As Range) Me.Range("vPGE_Res_E1Usage") = Me.Range("vUtilityUsage_Basic").Value End Sub Sub PGE_Bus_WriteUsage(ByVal Target As Range) Me.Range("vPGE_Bus_A1Usage") = Me.Range("vUtilityUsage_Basic").Value End Sub Sub SMUD_Res_WriteUsage(ByVal Target As Range) Me.Range("vSMUD_Res_Usage") = Me.Range("vUtilityUsage_Basic").Value End Sub A couple of questions: 1. Would I put the code on the sheet with the "vUtility_Company" or on the sheet where the data is being written? If it needs to go where the "vUtility_Company" data validation list is, how would I add it to an existing Private Sub Worksheet_Change(ByVal Target As Range) ? Currently it has 2 select cases using an If Not statement. 2. I can't get it to copy the data even if I tell it to run the sub. Can anybody tell me how to correct it? I should also mention the data being written is from a table the same size (3 Columns 12 Rows). How would I correct the code to make this happen? Thanks again for all the great help, Eric |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to remove the seconds on a VB mirror = cell | Excel Worksheet Functions | |||
How to remove the seconds on a mirror = cell coded in VB? | Excel Worksheet Functions | |||
Mirror value to another cell. | Excel Programming | |||
I want to customize a text depending of anwers in a lookup table | Excel Worksheet Functions | |||
Best way of "mirror" several cell areas on one sheet to others? | Excel Programming |