Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deny change of value of two target cells / enforce use of macros.
I have a macro that runs upon the change of the contents of a cell within a
particular column. The macro basically logs the user time, date and value change input and pastes this information into another worksheet. I have two queries. 1. If a value is pasted into more than one cell the macro does not work. How is it possible to deny the user the possibility of pasting a value into multiple cells? Is there something I can do with the Target.Count line at the top? 2. Is it possible to force the user to activate the macros upon opening the workbook so that the workbook cannot be changed without it being logged. I decided against the share workbooks/log changes option as this would require continual management of changes. Thanks in advance. Ade P My script is currently: Sub Worksheet_Change(ByVal Target As Range) Dim old_Val As Variant Dim new_Val As Variant Dim Sheet_Name As Variant If Target.Column = 10 Then If Target.Count 1 Then Exit Sub Application.ScreenUpdating = False On Error GoTo ErrHandler Application.EnableEvents = False new_Val = Target.Value Sheet_Name = ActiveSheet.Name Application.Undo old_Val = Target.Value Target.Value = new_Val ' // Various other instructions here // ErrHandler: Application.EnableEvents = True End If Application.ScreenUpdating = True End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
deny printing for certain blank cells | Excel Worksheet Functions | |||
Update Date Cell when any of target cells change | Excel Worksheet Functions | |||
Excel VBA Target Worksheet change | Excel Discussion (Misc queries) | |||
Deny file access if user declines macros? | Excel Discussion (Misc queries) | |||
Forcing Macros to Run (Else Deny Access to Workbook) | Excel Programming |