Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Change In Date Format to weeknumber automatically

Hi,
I need to change the entire column of dates in Weeknumber format
for example: column named CRD,CAD,AA and AB is in the date format
10/30/03, this must be changed as 44.
Have followed these steps & got the results
----------------------------------------------------------1. Go to tools
- Add-Ins -
2. Chck/Select the Analysis - ToolPak Add-In
3. Once done the feature allows you to give the the week number
4. eg. Type today's date ie. 15/10/2003 in cell A1
5. In cell B1 type the formula =WEEKNUM(A1) and u get the weeknumber
display .. ie. 44
----------------------------------------------------------
it works but this must be done one by one, ie. cell by cell. it is
possible to change the entire column without adding a extra column?

What I require - Enter a normal date in the format dd/mm/yyyy and it
automatically changes into the respective week number
Please revert asap

Warm regards,
Rajesh

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Change In Date Format to weeknumber automatically

Sub ConvertToWeekNum()
Dim rng As Range
Set rng = Range(Cells(1, ActiveCell.Column), _
Cells(Rows.Count, ActiveCell.Column).End(xlUp))
Varr = rng.Value
For i = 1 To UBound(Varr, 1)
Varr(i, 1) = DatePart("ww", Varr(i, 1))
Next
rng.Value = Varr
End Sub

This is lightly tested, but it appears to give the same result as weeknum.

Note that this is not the ISO standard for the Week number.

--
Regards,
Tom Ogilvy



"Rajesh Sharma" wrote in message
...
Hi,
I need to change the entire column of dates in Weeknumber format
for example: column named CRD,CAD,AA and AB is in the date format
10/30/03, this must be changed as 44.
Have followed these steps & got the results
----------------------------------------------------------1. Go to tools
- Add-Ins -
2. Chck/Select the Analysis - ToolPak Add-In
3. Once done the feature allows you to give the the week number
4. eg. Type today's date ie. 15/10/2003 in cell A1
5. In cell B1 type the formula =WEEKNUM(A1) and u get the weeknumber
display .. ie. 44
----------------------------------------------------------
it works but this must be done one by one, ie. cell by cell. it is
possible to change the entire column without adding a extra column?

What I require - Enter a normal date in the format dd/mm/yyyy and it
automatically changes into the respective week number
Please revert asap

Warm regards,
Rajesh

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



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
Earliest date using WEEKNUMBER Jock Excel Worksheet Functions 3 September 17th 07 10:17 AM
convert date (YYYYMMDD) to weeknumber mark paul Excel Worksheet Functions 1 February 27th 07 12:05 PM
Calculate a date based on a weeknumber brian martens Excel Discussion (Misc queries) 2 January 22nd 07 09:47 PM
Calculate a date based on a weeknumber brian martens Excel Worksheet Functions 2 January 22nd 07 09:47 PM
how do i make a date change automatically if i change one before . dpl7579 Excel Discussion (Misc queries) 1 January 11th 05 09:21 PM


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