Thread: Date issue
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Jim Savage Jim Savage is offline
external usenet poster
 
Posts: 2
Default Date issue

Dave and Bob,

You guys are great. That worked like a charm. I didn't even know about that
type of code. I am indebted to you both for showing me the way ( Buddist
Chant OUWMMMMMMMM)

Thanks again
JIM

"Dave Peterson" wrote:

Select the worksheet that should have this behavior.
Rightclick on that worksheet tab.
Select View Code

Paste this modified version of Bob's code into the newly opened code window (to
the right):

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A:A" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target.offset(0,5)
.Value = date
.numberformat = "dd mmm yyyy"
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

Then back to excel and type something in column A.

If nothing happens to column F for that row, then close and save the workbook.

And then reopen it, but allow macros to run.



Jim Savage wrote:

I'm sorry if I didn't explain before but, I'm not real good at this. I almost
get it. Can you write this in more of a formula format? Sorry to be a pain
but, Spreadsheets aren't my specialty by any means. I try to stick to CAD.

Thanks

"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A:A" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
.Offset(0,5).Value = format(date,@dd mmm yyyy@)
End With
End If

ws_exit:
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


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Jim Savage" <Jim wrote in message
...
I am authoring a simple spreadsheet. I want to have it so that If column A
has any value entered what so ever that column f will display the date
that
the entry was made. Is this possible? Any Suggestions?




--

Dave Peterson