Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 2003/2007 Need to have Var "OrigRows" established in a Worksheet_Activate event. Then, once established, I would like to have "OrigRows" available to a second Private Sub Worksheet_Change procedure as below. I understand that I cannot declare a Global or Public variable in an object I have never used a Propery Get. How can I weave the code below together? Property Get OrigRows() As Long OrigRows = Sheets("Trial Balance Current").UsedRange.Rows.Count End Property Private Sub Worksheet_Change(ByVal Target As Range) If Sheets("Trial Balance Current").Rows.Count OrigRows Then Dim myRange As Range ActiveSheet.Unprotect Password:="calldennis" Set myRange = Intersect(ActiveSheet.UsedRange, Selection) Selection.Locked = False Selection.FormulaHidden = False ActiveSheet.Protect Password:="calldennis", DrawingObjects:=False, Contents:=True, _ Scenarios:=False, AllowFormattingCells:=True, AllowFormattingRows:=True, _ AllowInsertingRows:=True, AllowSorting:=True, AllowFiltering:=True, _ AllowUsingPivotTables:=True End If End Sub TIA EagleOne |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Get Property value of class instance by passing string property name | Excel Programming | |||
Runtime error 380 - Could not set the list property. Invalid property value. | Excel Programming | |||
Could not set the ControlSource property. Invalid property value error | Excel Programming | |||
Runtime Error 380 – Could not set the list property. Invalid property value | Excel Programming | |||
Runtime error 380: Could not set the List property. invalid property value of listbox | Excel Programming |