+ Reply to Thread
Results 1 to 5 of 5

Looping through day of week

  1. #1
    Forum Contributor JP Romano's Avatar
    Join Date
    10-09-2008
    Location
    Princeton, NJ
    MS-Off Ver
    2010
    Posts
    500

    Looping through day of week

    Hi all...
    I'm trying to set up a simple macro to loop through some number of dates on a sheet and blank out fields next to every instance of Saturday and Sunday.

    The only problem I'm having is actually finding the values "Saturday" and "Sunday"

    Given a date in this format: 01/01/2009
    I can convert to "Thursday"

    Problem is, the vba code still "sees" 01/01/2009

    I've tried copy / paste special / paste values to no avail.
    I've tried changing it via VBA (a few different methods, including strings, formats, etc) with no luck.
    Even tried referencing my date cells from another spreadsheet and pasting the values back in. Can't seem to get 01/01/2009 to be "Thursday"

    I'm sure I'm missing something pretty simple. Can any of you smack some sense into me?

    Thanks
    Last edited by VBA Noob; 03-17-2009 at 04:41 PM. Reason: Solving

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Looping through day of week

    You can use something like

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Looping through day of week

    Just another sample


    Please Login or Register  to view this content.
    Charles

    There are other ways to do this, this is but 1 !
    Be Sure you thank those who helped.
    IF YOU'RE SATISFIED BY ANY MEMBERS RESPONSE TO YOUR ISSUE PLEASE USE THE STAR ICON AT THE BOTTOM LEFT OF THE POST UNDER THEIR NAME.

  4. #4
    Forum Contributor JP Romano's Avatar
    Join Date
    10-09-2008
    Location
    Princeton, NJ
    MS-Off Ver
    2010
    Posts
    500

    Re: Looping through day of week

    Donkey / Charles... ah, thanks. Very helpful and, of course, successful.

    You guys are as generous with your time as you are knowledgeable on the subjects on hand.

  5. #5
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Looping through day of week

    Your welcome

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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