#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default audit trail

I need to check to see if a user exceeded a workload and then realized it and
went back and changed their entry. Is there a way to do this?

The sheet sums several columns and if the value is greater than 100 the row
highlights red. What I need to now is if they ever exceeded 100 and went
back and changed some of the columns so they were under 100. I hope this
makes sense.

Thanks,
Mike
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default audit trail

This is a simple example assuming the sum formulas are in cells A10 thru D10.
This macro examines the sums and the date is inserted in the cell below if
the sum exceeds 100. This date does not go away after the sum is corrected:

Private Sub Worksheet_Calculate()
Set r = Range("A10:D10")
For Each rr In r
If rr.Value 100 Then
Application.EnableEvents = False
rr.Offset(1, 0).Value = Date
Application.EnableEvents = True
End If
Next
End Sub


Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm


--
Gary''s Student - gsnu200770


"MIke" wrote:

I need to check to see if a user exceeded a workload and then realized it and
went back and changed their entry. Is there a way to do this?

The sheet sums several columns and if the value is greater than 100 the row
highlights red. What I need to now is if they ever exceeded 100 and went
back and changed some of the columns so they were under 100. I hope this
makes sense.

Thanks,
Mike

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default audit trail

Gary's Student,
Thanks for the help. The macro you gave me works great but I tried to
expand it to check an additional cell value in another column and I cant get
it to work. I have some code that I used to lock cells after a value was
exceeded in a cell but when I used this code I had to spend alot of time
unlocking sheets because they mistakenly entered the wrong number I would
rather use the date audit that you supplied. Is there an easy way to convert
it into putting the date into a cell instead of locking it? I appreciate all
of your help. Mike

'Private Sub Worksheet_Change(ByVal Target As Range)
'Dim myCell As Range
' On Error GoTo ws_exit:
' Application.EnableEvents = False
' ActiveSheet.Unprotect Password:="justme"
' For Each myCell In Range("O7:O37")
' If myCell.Value [100] Or myCell.Offset(0, 2).Value [12.5] Then
' Range(myCell.Offset(0, -1), myCell.Offset(0, -13)).Locked = True
' Else
' Range(myCell.Offset(0, -1), myCell.Offset(0, -13)).Locked = False
' End If
' Next myCell
'ActiveSheet.Protect Password:="justme"
'
'ws_exit:
'
' Application.EnableEvents = True
'End Sub



"Gary''s Student" wrote:

This is a simple example assuming the sum formulas are in cells A10 thru D10.
This macro examines the sums and the date is inserted in the cell below if
the sum exceeds 100. This date does not go away after the sum is corrected:

Private Sub Worksheet_Calculate()
Set r = Range("A10:D10")
For Each rr In r
If rr.Value 100 Then
Application.EnableEvents = False
rr.Offset(1, 0).Value = Date
Application.EnableEvents = True
End If
Next
End Sub


Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm


--
Gary''s Student - gsnu200770


"MIke" wrote:

I need to check to see if a user exceeded a workload and then realized it and
went back and changed their entry. Is there a way to do this?

The sheet sums several columns and if the value is greater than 100 the row
highlights red. What I need to now is if they ever exceeded 100 and went
back and changed some of the columns so they were under 100. I hope this
makes sense.

Thanks,
Mike

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default audit trail

I will look at your code tomorrow.
--
Gary''s Student - gsnu200770


"MIke" wrote:

Gary's Student,
Thanks for the help. The macro you gave me works great but I tried to
expand it to check an additional cell value in another column and I cant get
it to work. I have some code that I used to lock cells after a value was
exceeded in a cell but when I used this code I had to spend alot of time
unlocking sheets because they mistakenly entered the wrong number I would
rather use the date audit that you supplied. Is there an easy way to convert
it into putting the date into a cell instead of locking it? I appreciate all
of your help. Mike

'Private Sub Worksheet_Change(ByVal Target As Range)
'Dim myCell As Range
' On Error GoTo ws_exit:
' Application.EnableEvents = False
' ActiveSheet.Unprotect Password:="justme"
' For Each myCell In Range("O7:O37")
' If myCell.Value [100] Or myCell.Offset(0, 2).Value [12.5] Then
' Range(myCell.Offset(0, -1), myCell.Offset(0, -13)).Locked = True
' Else
' Range(myCell.Offset(0, -1), myCell.Offset(0, -13)).Locked = False
' End If
' Next myCell
'ActiveSheet.Protect Password:="justme"
'
'ws_exit:
'
' Application.EnableEvents = True
'End Sub



"Gary''s Student" wrote:

This is a simple example assuming the sum formulas are in cells A10 thru D10.
This macro examines the sums and the date is inserted in the cell below if
the sum exceeds 100. This date does not go away after the sum is corrected:

Private Sub Worksheet_Calculate()
Set r = Range("A10:D10")
For Each rr In r
If rr.Value 100 Then
Application.EnableEvents = False
rr.Offset(1, 0).Value = Date
Application.EnableEvents = True
End If
Next
End Sub


Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm


--
Gary''s Student - gsnu200770


"MIke" wrote:

I need to check to see if a user exceeded a workload and then realized it and
went back and changed their entry. Is there a way to do this?

The sheet sums several columns and if the value is greater than 100 the row
highlights red. What I need to now is if they ever exceeded 100 and went
back and changed some of the columns so they were under 100. I hope this
makes sense.

Thanks,
Mike

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default audit trail

If the users are bright enough to re-enter data to get below a certain
threshhold, they would be bright enough to delete the date stamp from a cell
once they got back below 100.


Gord Dibben MS Excel MVP

On Tue, 26 Feb 2008 11:20:01 -0800, MIke wrote:

Gary's Student,
Thanks for the help. The macro you gave me works great but I tried to
expand it to check an additional cell value in another column and I cant get
it to work. I have some code that I used to lock cells after a value was
exceeded in a cell but when I used this code I had to spend alot of time
unlocking sheets because they mistakenly entered the wrong number I would
rather use the date audit that you supplied. Is there an easy way to convert
it into putting the date into a cell instead of locking it? I appreciate all
of your help. Mike

'Private Sub Worksheet_Change(ByVal Target As Range)
'Dim myCell As Range
' On Error GoTo ws_exit:
' Application.EnableEvents = False
' ActiveSheet.Unprotect Password:="justme"
' For Each myCell In Range("O7:O37")
' If myCell.Value [100] Or myCell.Offset(0, 2).Value [12.5] Then
' Range(myCell.Offset(0, -1), myCell.Offset(0, -13)).Locked = True
' Else
' Range(myCell.Offset(0, -1), myCell.Offset(0, -13)).Locked = False
' End If
' Next myCell
'ActiveSheet.Protect Password:="justme"
'
'ws_exit:
'
' Application.EnableEvents = True
'End Sub



"Gary''s Student" wrote:

This is a simple example assuming the sum formulas are in cells A10 thru D10.
This macro examines the sums and the date is inserted in the cell below if
the sum exceeds 100. This date does not go away after the sum is corrected:

Private Sub Worksheet_Calculate()
Set r = Range("A10:D10")
For Each rr In r
If rr.Value 100 Then
Application.EnableEvents = False
rr.Offset(1, 0).Value = Date
Application.EnableEvents = True
End If
Next
End Sub


Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm


--
Gary''s Student - gsnu200770


"MIke" wrote:

I need to check to see if a user exceeded a workload and then realized it and
went back and changed their entry. Is there a way to do this?

The sheet sums several columns and if the value is greater than 100 the row
highlights red. What I need to now is if they ever exceeded 100 and went
back and changed some of the columns so they were under 100. I hope this
makes sense.

Thanks,
Mike


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
Help with time audit Mike Busch[_2_] Excel Discussion (Misc queries) 0 December 18th 07 03:21 PM
Downloading Excel 2003 to replace 2000 and keep trail 20007 versio cb New Users to Excel 6 October 12th 07 05:08 AM
Forecast Function - Why does rate of growth trail off with time??? BenS Excel Discussion (Misc queries) 2 June 12th 07 10:56 PM
Audit Trail Pendelfin Excel Discussion (Misc queries) 1 January 23rd 06 03:04 PM
excel trail balance worksheet leeonline Excel Discussion (Misc queries) 1 January 7th 05 03:19 AM


All times are GMT +1. The time now is 12:26 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"