Type date in first cell of row, 13 columns over - auto extractsmonth for each row

B

Bull

Quick questions:

How can I put Code in a Worksheet (on Selection change), where for
each row, I type 11/15/08 in the first cell, and in column "M" of the
same row, the 11 is inserted from the date in column A.

Example:
In row 66,
I type 11/15/08 in Cell A66,
In Cell M66, 11 is automatically extracted and inserted

What is the code for doing this for each row, not just row 66, all
rows.

Thanks.
Bull
 
D

dbKemp

Quick questions:

How can I put Code in a Worksheet (on Selection change), where for
each row, I type 11/15/08 in the first cell, and in column "M" of the
same row, the 11 is inserted from the date in column A.

Example:
In row 66,
I type 11/15/08 in Cell A66,
In Cell M66, 11 is automatically extracted and inserted

What is the code for doing this for each row, not just row 66, all
rows.

Thanks.
Bull

Try this:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
If IsDate(Target.Value) Then
Target.Offset(0, 12).Value = Month(Target.Value)
End If
End If
End Sub
 
B

Bull

Try this:

Private Sub Worksheet_Change(ByVal Target As Range)
   If Target.Column = 1 Then
      If IsDate(Target.Value) Then
         Target.Offset(0, 12).Value = Month(Target.Value)
      End If
   End If
End Sub- Hide quoted text -

- Show quoted text -

worked great, thank you.
bull
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top