Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
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
deny printing for certain blank cells huntnpeck2 Excel Worksheet Functions 2 October 3rd 07 04:57 PM
Update Date Cell when any of target cells change DAKent Excel Worksheet Functions 2 September 11th 07 07:18 PM
Excel VBA Target Worksheet change [email protected] Excel Discussion (Misc queries) 1 March 2nd 06 02:33 PM
Deny file access if user declines macros? [email protected] Excel Discussion (Misc queries) 3 February 7th 05 03:02 PM
Forcing Macros to Run (Else Deny Access to Workbook) Alan Excel Programming 2 September 20th 03 12:03 PM


All times are GMT +1. The time now is 09:37 PM.

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

About Us

"It's about Microsoft Excel"