Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Merged cells can cause lots of trouble--I try not to use them.
PYO1012 wrote: Thank you, Dave, for responding! I tried exactly what you suggested "..Offset(0, -2).value = "" " and that worked perfectly. Thank you, again!! "Dave Peterson" wrote: First, the code doesn't run when you start to change the cell--it fires when you finish (hitting enter or tab or selecting another cell). Which line causes the error? Please share the exact details--addresses, values in the cells that are changing and your keystrokes of what you're doing. The only thing that I see that could be causing trouble is this line: ..Offset(0, -2).ClearContents This will fail if that .offset(0,-2) cell is part of a merged set of cells. If you're using merged cells, change this line to: ..Offset(0, -2).value = "" PYO1012 wrote: I have a question: I've been using Dave's macro for a while now but there's one thing I wish I could resolve... The problem is a Debug error that occurs when I start to type in the cell that triggers the timestamp but then decide to delete what I was typing and leave the cell with no information. Is there something that can be added to the following macro to have it keep the debug error from happening when I leave the trigger cell blank after clicking in it? Private Sub Worksheet_Change(ByVal Target As Excel.Range) With Target If .Count 1 Then Exit Sub If Not Intersect(Range("E11:E510"), .Cells) Is Nothing Then Application.EnableEvents = False If IsEmpty(.Value) Then .Offset(0, -2).ClearContents Else With .Offset(0, -2) .NumberFormat = "hh:mm" .Value = Time End With End If Application.EnableEvents = True End If End With End Sub Any help would be appreciated! -- Dave Peterson . -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Date stamp when a value is entered in a cell | Excel Worksheet Functions | |||
Date stamp when a value is entered in a cell on another worksheet | Excel Worksheet Functions | |||
Create a button that will date stamp todays date in a cell | Excel Discussion (Misc queries) | |||
How do I set an automatic date stamp into a cell in Excel? | Excel Worksheet Functions | |||
Setting up a date and time stamp in a cell | Excel Programming |