#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Debug Issue

Hi,

Project: Compensation Tool for the companies review/promotion.

I have built a table so that it when a change is made it records the change
made on the individual line item (first code) and I also have put a time
stamp if any change is made to the entire spreadsheet (second code). I sent
the comp tool out for my co-workers to test it. When they enter #s for new
salaries, they get a error to debug and it does not record the date and time.
I do not get this error. Can someone let me know what is wrong with my
code? I believe the error is in this line (.NumberFormat = "mm/dd/yyyy
[$-409]h:mm:ss AM/PM;@"). Thanks.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim myRow As Long

If Target.Cells.Count 1 Then
Exit Sub 'one cell at a time
End If

If Application.Intersect(Target, Me.Range("AD12:AN76")) Is Nothing Then
'do nothing
Else
myRow = Target.Row
With Me.Cells(myRow, "AO")
.NumberFormat = "mm/dd/yyyy [$-409]h:mm:ss AM/PM;@"
Application.EnableEvents = False
.Value = Now
Application.EnableEvents = True
End With
End If

Application.EnableEvents = False
Range("C7").Value = Now
Application.EnableEvents = True
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Debug Issue

It worked ok for me.

Maybe you should drop the localization stuff and try:

..NumberFormat = "mm/dd/yyyy h:mm:ss AM/PM;@"



DataGuy wrote:

Hi,

Project: Compensation Tool for the companies review/promotion.

I have built a table so that it when a change is made it records the change
made on the individual line item (first code) and I also have put a time
stamp if any change is made to the entire spreadsheet (second code). I sent
the comp tool out for my co-workers to test it. When they enter #s for new
salaries, they get a error to debug and it does not record the date and time.
I do not get this error. Can someone let me know what is wrong with my
code? I believe the error is in this line (.NumberFormat = "mm/dd/yyyy
[$-409]h:mm:ss AM/PM;@"). Thanks.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim myRow As Long

If Target.Cells.Count 1 Then
Exit Sub 'one cell at a time
End If

If Application.Intersect(Target, Me.Range("AD12:AN76")) Is Nothing Then
'do nothing
Else
myRow = Target.Row
With Me.Cells(myRow, "AO")
.NumberFormat = "mm/dd/yyyy [$-409]h:mm:ss AM/PM;@"
Application.EnableEvents = False
.Value = Now
Application.EnableEvents = True
End With
End If

Application.EnableEvents = False
Range("C7").Value = Now
Application.EnableEvents = True
End Sub


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Debug Issue

Thanks for the suggestion Dave. I am not quite sure what exactly to do.
Could you perhaps explain.

"Dave Peterson" wrote:

It worked ok for me.

Maybe you should drop the localization stuff and try:

..NumberFormat = "mm/dd/yyyy h:mm:ss AM/PM;@"



DataGuy wrote:

Hi,

Project: Compensation Tool for the companies review/promotion.

I have built a table so that it when a change is made it records the change
made on the individual line item (first code) and I also have put a time
stamp if any change is made to the entire spreadsheet (second code). I sent
the comp tool out for my co-workers to test it. When they enter #s for new
salaries, they get a error to debug and it does not record the date and time.
I do not get this error. Can someone let me know what is wrong with my
code? I believe the error is in this line (.NumberFormat = "mm/dd/yyyy
[$-409]h:mm:ss AM/PM;@"). Thanks.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim myRow As Long

If Target.Cells.Count 1 Then
Exit Sub 'one cell at a time
End If

If Application.Intersect(Target, Me.Range("AD12:AN76")) Is Nothing Then
'do nothing
Else
myRow = Target.Row
With Me.Cells(myRow, "AO")
.NumberFormat = "mm/dd/yyyy [$-409]h:mm:ss AM/PM;@"
Application.EnableEvents = False
.Value = Now
Application.EnableEvents = True
End With
End If

Application.EnableEvents = False
Range("C7").Value = Now
Application.EnableEvents = True
End Sub


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Debug Issue

Make this line:
..NumberFormat = "mm/dd/yyyy [$-409]h:mm:ss AM/PM;@"
look like:
..NumberFormat = "mm/dd/yyyy h:mm:ss AM/PM;@"



DataGuy wrote:

Thanks for the suggestion Dave. I am not quite sure what exactly to do.
Could you perhaps explain.

"Dave Peterson" wrote:

It worked ok for me.

Maybe you should drop the localization stuff and try:

..NumberFormat = "mm/dd/yyyy h:mm:ss AM/PM;@"



DataGuy wrote:

Hi,

Project: Compensation Tool for the companies review/promotion.

I have built a table so that it when a change is made it records the change
made on the individual line item (first code) and I also have put a time
stamp if any change is made to the entire spreadsheet (second code). I sent
the comp tool out for my co-workers to test it. When they enter #s for new
salaries, they get a error to debug and it does not record the date and time.
I do not get this error. Can someone let me know what is wrong with my
code? I believe the error is in this line (.NumberFormat = "mm/dd/yyyy
[$-409]h:mm:ss AM/PM;@"). Thanks.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim myRow As Long

If Target.Cells.Count 1 Then
Exit Sub 'one cell at a time
End If

If Application.Intersect(Target, Me.Range("AD12:AN76")) Is Nothing Then
'do nothing
Else
myRow = Target.Row
With Me.Cells(myRow, "AO")
.NumberFormat = "mm/dd/yyyy [$-409]h:mm:ss AM/PM;@"
Application.EnableEvents = False
.Value = Now
Application.EnableEvents = True
End With
End If

Application.EnableEvents = False
Range("C7").Value = Now
Application.EnableEvents = True
End Sub


--

Dave Peterson


--

Dave Peterson
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
Debug on userform Jase Excel Discussion (Misc queries) 1 May 28th 08 05:00 PM
When I try to save, it says debug, what does that mean? kali Excel Discussion (Misc queries) 1 January 10th 07 03:17 AM
DeBug Ollie Excel Discussion (Misc queries) 4 April 28th 06 03:17 PM
Function debug help please Adam Kroger Excel Discussion (Misc queries) 3 November 27th 05 09:09 PM
help with debug Rusty New Users to Excel 3 February 2nd 05 03:16 AM


All times are GMT +1. The time now is 01:10 PM.

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"