Closed Thread
Results 1 to 2 of 2

Choose left 3 cell contents

Hybrid View

SeanEvans Choose left 3 cell contents 01-07-2005, 10:44 AM
blane245 Re: Choose left 3 cell... 01-08-2010, 04:26 PM
  1. #1
    Registered User
    Join Date
    09-23-2004
    Posts
    4

    Choose left 3 cell contents

    I have a list of dates ( an entire year ) in the format -

    Mon 13 Dec 2004

    However I only need the list to contain weekedays i.e. and would like to use a simpla macro to delete the lines that start with Sat or Sun. I just can't figure out the syntax of the command as so far I have been trying stuff like

    If ActiveCell.Left(3) = "Sat" Then

    to no avail.

    Can anyone point out the correct syntax for me ?

    Thanks

  2. #2
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Choose left 3 cell contents

    dim wd as Integer
    wd = Weekday(ActiveCell.Value)
    if (wd = vbSunday or wd = vbSaturday) Then ...
    The Weekday function will do what you want assuming that the cell contents is actually a n Excel date value, not a string that looks like a date.

Closed 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