LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,670
Default Code error to mirror data from one table to another

Hello,

I can't figure out what is wrong with the following code. Everything works,
except for the "'subs to copy utility usage data" My goal with these subs is
to copy data from one table to another. I want all changes to the data to be
immediately updated. Also the data is always entered into the table (which is
named and has 3 columns and 13 rows) on the left side of the equation to a
table on the right side of the code . I should mention that the named table
data I am copying doesn't include the table headers. I am fairly new to VBA
code, can somebody tell me where I went wrong? Here is my code:


Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
'Hide/Unhide Rows when you change Utility Company on the phone script
If Not (Intersect(Target, Me.Range("vUtility_Company")) Is Nothing) Then
Select Case LCase(Me.Range("vUtility_Company").Value)
Case LCase("")
Call PS_MinimizeALL
Case LCase("PGE Residential")
Call PS_MinimizeALL
Call PGE_Res
Call PGE_Res_WriteUsage
Case LCase("PGE Business")
Call PS_MinimizeALL
Call PGE_Bus
Call PGE_Bus_WriteUsage
Case LCase("SMUD Residential")
Call PS_MinimizeALL
Call SMUD_Res
Call SMUD_Res_WriteUsage
Case LCase("Debug")
Call Show_All
Case Else
'do nothing, just continue to the end sub
End Select
Else
'Hide/Unhide Rows when you change Rent/Own Value
If Not (Intersect(Target, Me.Range("vRentOwn")) Is Nothing) Then
Select Case LCase(Me.Range("vRentOwn").Value)
Case LCase("")
Call PS_MinimizeRentOwn
Case LCase("Rent")
Call PS_MaximizeRentOwn
Case LCase("Own")
Call PS_MinimizeRentOwn
Case Else
End Select
End If
End If

End Sub
'Subs for Utility Company
Sub Show_All()
Me.Rows("30:1000").EntireRow.Hidden = False
End Sub
Sub PS_MinimizeALL()
Me.Range("vPS_MinAll_Utilities").EntireRow.Hidden = True
End Sub
Sub PGE_Res()
Me.Range("vPS_PGE_Res").EntireRow.Hidden = False
End Sub
Sub PGE_Bus()
Me.Range("vPS_PGE_Bus").EntireRow.Hidden = False
End Sub
Sub SMUD_Res()
Me.Range("vPS_SMUD_Res").EntireRow.Hidden = False
End Sub
'Subs for Rent/Own
Sub PS_MinimizeRentOwn()
Me.Range("vRentOwn_Rows").EntireRow.Hidden = True
End Sub
Sub PS_MaximizeRentOwn()
Me.Range("vRentOwn_Rows").EntireRow.Hidden = False
End Sub
'Subs for copying utility usage data
Sub PGE_Res_WriteUsage()
Me.Range("vPGE_Res_E1Usage").Value = Me.Range("vUtilityUsage_Basic").Value
End Sub
Sub PGE_Bus_WriteUsage()
Me.Range("vPGE_Bus_A1Usage").Value = Me.Range("vUtilityUsage_Basic").Value
End Sub
Sub SMUD_Res_WriteUsage()
Me.Range("vSMUD_Res_Usage").Value = Me.Range("vUtilityUsage_Basic").Value
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for an excel function which can mirror opposite the data wilchong via OfficeKB.com New Users to Excel 3 May 11th 12 07:13 PM
synchronizing mutiple sheets to mirror the previous data FEMoore Excel Discussion (Misc queries) 0 October 10th 10 03:49 PM
mirror table depending on cell value Eric Excel Programming 0 August 5th 08 04:59 AM
Duplicating/Mirror Data into another worksheet within same workboo TJ Excel Worksheet Functions 1 May 6th 08 09:39 AM
How do you mirror data and formatting in Excel '03 Jorg Excel Worksheet Functions 1 August 1st 07 03:36 PM


All times are GMT +1. The time now is 10:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"