+ Reply to Thread
Results 1 to 7 of 7

Convert Serial Number to Date WITH TEXT

  1. #1
    Registered User
    Join Date
    11-04-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    86

    Convert Serial Number to Date WITH TEXT

    Hello,
    I know one can convert a serial number to a date by using formatting, but I am needing this to be done b/c the serial number is concatenated with some text (the word week i.e.
    1/3/11 Week). However, I did try to format the cell but Excel keeps the date as a serial number.
    The other half of my issue is I need to do this for a whole year of dates in a specified range and I was wondering if someone could give me an example of a macro I'd write up to basically change the bolded cells in the attached workbook to this format: m/d/yy along with the word 'week' concatenated to it and for these cells to refer to the first cell in the cells that precede it. Like I said, see the attached workbook to get a clear understanding of what I am trying to do. Thnx.

    -HP RodNuclear
    Last edited by HP RodNuclear; 12-20-2010 at 12:42 PM.

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Convert Serial Number to Date WITH TEXT

    You could use the formula:
    =TEXT(A1,"m/d/yy ") &"Week"
    Regards,
    Antonio

  3. #3
    Registered User
    Join Date
    11-04-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    86

    Re: Convert Serial Number to Date WITH TEXT

    Thanks Antonio. That worked great. Now, would you know a way in Visual Basic that I could automate this process so that it would do that every 8th cell but be referring back to the first cell in it's series?

  4. #4
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Convert Serial Number to Date WITH TEXT

    You could use this code. Remember to set the year you need:
    Please Login or Register  to view this content.
    Regards,
    Antonio

  5. #5
    Registered User
    Join Date
    11-04-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    86

    Re: Convert Serial Number to Date WITH TEXT

    This is amazing. That is exactly what I needed. However, if I wanted to this to go into the next year, how would I change the loop to keep going into the next year. I'm still new to this programming gig, but I imagine something needs to be added so that the loop will continue UNTIL the 'myyear' is reached.

  6. #6
    Registered User
    Join Date
    11-04-2010
    Location
    Illinois
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    86

    Re: Convert Serial Number to Date WITH TEXT

    Also, what if I wanted to space the groupings by month? For example, right now, it lists the days and the 'week' portion exactly how I want it but I wanted to put some empty rows (4 to be exact) in between each month, so that as it goes through the looping, once it gets to the end of that month, it will stop, add 4 rows and continue as normal with the loop, including the formatting.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Convert Serial Number to Date WITH TEXT

    Hello HP RodNuclear,

    It appears that Antonio has provided you with a solution to your original question. Your other questions are about formatting your worksheet. You should start a new thread to keep the posts relavent to your original question.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1