Problem with code

A

adam

Dear all

please see below a previous post made and a resolution posted however this code is returning an error. Can anyone see where this error is. Also do I paste this code into a module or not

Thank
Ada
---------------------------------

Hi, Adam

Not impossible at all. Why not date-stamp each use
entry in a column for each data entry row, so you ca
create a little macro to clear all old dates

something like

Private Sub Worksheet_Change(ByVal Target As Range
If Target.Cells.Count > 1 Then Exit Su
If Intersect(Target, Me.Range("C1:C5")) Is Nothing Then
Exit Su
Application.EnableEvents = Fals
Target.Offset(0, 10) = Now(
Application.EnableEvents = Tru
End Su

(this line:Me.Range("C1:C5")) checks to make sure use
is in the cells which trigger the date-stamp- adjust
this of course

hope this helps a little
jef
-----Original Message----
Dear all covering the day prior
About 10 team members all complete daily stats sheets
detailing the number of work cases they have resolved and
then all email there individual stats sheets to me, which
I have to printoff!! And collateindividual sheets for each team member, so that this can
be input and I can collate all of this information onto
one pageso if I do a shared worksheet there will be data in there
which is 2 days old which I do not want, I only want the
previous working days figures (Working week = Monday to
Saturday)data in the workbook that is older than 2 working days?
I'd protect the workbook so the cretins cannot change the
layout as well
 
M

Max

Try this:

Right-click on the sheet tab > View Code

Paste Jeff's code, slightly amended below (added an "End If" ..)
into the whitespace on the right
(Clear the defaults in the whitespace first)

Press Alt+Q to get back to Excel, and try it out (should work now ..)

-------
Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("C1:C5")) Is Nothing Then
Exit Sub
End If

Application.EnableEvents = False
Target.Offset(0, 10) = Now()
Application.EnableEvents = True

End Sub
------
--
Rgds
Max
xl 97
--
Please respond, in newsgroup
xdemechanik <at>yahoo<dot>com
---
adam said:
Dear all,

please see below a previous post made and a resolution posted however this
code is returning an error. Can anyone see where this error is. Also do I
paste this code into a module or not?
 
B

Bob Phillips

Hi Adam,

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("C1:C5")) Is Nothing Then
Exit Sub
End If
Application.EnableEvents = False
Target.Offset(0, 10) = Now()
Application.EnableEvents = True
End Sub


'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

adam said:
Dear all,

please see below a previous post made and a resolution posted however this
code is returning an error. Can anyone see where this error is. Also do I
paste this code into a module or not?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top