Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Type date in first cell of row, 13 columns over - auto extractsmonth for each row

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Type date in first cell of row, 13 columns over - auto extractsmonth for each row

On Nov 4, 3:17 pm, Bull wrote:
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Type date in first cell of row, 13 columns over - auto extractsmonth for each row

On Nov 4, 12:39*pm, dbKemp wrote:
On Nov 4, 3:17 pm, Bull wrote:





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- Hide quoted text -

- Show quoted text -


worked great, thank you.
bull
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
When I type a date in a cell, can I eliminate just #### showing? skyeryder New Users to Excel 2 November 4th 08 10:27 PM
Can I type text in one cell and have a value auto-enter in 2nd cel IowaTBone Excel Programming 4 July 9th 07 11:20 PM
I type a date (1/05) in a cell, press enter, it reads ####.Why? KIWI New Users to Excel 2 February 5th 07 03:14 PM
auto date script for 2 columns? have 1.. nastech Excel Discussion (Misc queries) 2 November 22nd 05 03:10 PM
auto type text onclick in a cell nospam Excel Programming 2 July 26th 04 05:11 AM


All times are GMT +1. The time now is 06:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"