LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Change date to display as # week of the year

Hello all,

I have the following code and I want to change the format from "mmmm" to "ww"
so the cell will display the week of the year. i.e. week 13, week 12 but
only the number is needed. i.e. "13".

i've tried change the "mmmm" to "ww" but it displays "13" for every date. I
have dates from last week and the date for today so i expected to see 12 for
the dates from last week and 13 for todays date.

Any thoughts? Thanks in advance!!

Here's my code....

With Columns(2)

Set b = .Find(what:="", after:=Cells(1, 2))

b.Select
ActiveSheet.Paste
b.Offset(0, -1).Select
Selection = b

End With

Dim sStr As String
sStr = Format(Date, "mmmm")

With Columns(1)

Set a = .Find(what:="", after:=Cells(1, 1))

a.Offset(-1, 0).Select
Selection = sStr

End With
 
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
Convert Month, Week, Year to date Pete Hay Excel Worksheet Functions 3 February 2nd 10 12:43 AM
How do I convert a date to a week of the year? JBTexas Excel Discussion (Misc queries) 12 September 5th 07 10:14 PM
Finding the date using the number of the week in a year Bhupinder Rayat Excel Worksheet Functions 2 March 30th 07 11:20 AM
how to insert month date year and day of week Sachi Noma Excel Discussion (Misc queries) 3 May 19th 06 03:03 AM
how to insert month date year and day of week Sachi Noma Excel Worksheet Functions 3 May 19th 06 03:03 AM


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