#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Auto Dates

Okay, I see your intent better now. Glad you are sorted.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Merle" wrote in message
...
Thanks Bob that did the trick. I did have to delete these two lines.

If Target.Cells.Column = 1 Then
n = Target.Row

It would only put the paid date in (Col. A) of Sheet 2 but without those
two
lines it works great.

Again Thanks for all your help.

Merle

"Bob Phillips" wrote:

I'm thinking that I don't really understand what you want to do, but I'll
take a pop anyway

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col A
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
n = Target.Row
For Each cell In Me.Range("A2:M6")
If IsNumeric(cell.Value) Then
If cell.Value 1 Then
Worksheets(2).Range(cell.Address(0, 0)).Value _
= "paid" & Format(Now, "mm/dd")
End If
End If
Next cell
End If
enditall:
Application.EnableEvents = True
End Sub

or alternatively

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col A
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
If Not Intersect(Target, Me.Range("A2:M6")) Is Nothing Then
If IsNumeric(Target.Value) Then
If Target.Value 1 Then
Worksheets(2).Range(Target.Address(0, 0)).Value _
= "paid" & Format(Now, "mm/dd")
End If
End If
Next cell
End If
enditall:
Application.EnableEvents = True
End Sub



--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Merle" wrote in message
...
I am using Excel 2000 and this code in sheet 1 and it works fine. What I
want
to do is change the range to A2 to M6. When I replace "A" with "A1:M6"
it
will not work. Can anyone help me with this?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col A
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
n = Target.Row
If IsNumeric(Excel.Range("A" & n).Value) And _
Excel.Range("A" & n).Value 1 Then
Excel.Sheets(2).Range("A" & n).Value = "paid" & Format(Now,
"
mm/dd")
End If
End If
enditall:
Application.EnableEvents = True
End Sub






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
Auto dates chesjak Excel Worksheet Functions 2 June 4th 06 03:56 PM
Auto generated dates Fifi Excel Discussion (Misc queries) 1 March 31st 06 04:37 PM
Auto fill dates Jennifer Excel Worksheet Functions 0 March 24th 06 07:32 PM
auto posting dates maintchief New Users to Excel 1 October 28th 05 01:20 AM
Auto dates D Excel Worksheet Functions 0 June 22nd 05 06:01 PM


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