+ Reply to Thread
Results 1 to 7 of 7

Macro to Fill Cells with H if it is a Friday or a Saturday

  1. #1
    Forum Contributor
    Join Date
    06-03-2004
    Location
    India
    MS-Off Ver
    2013
    Posts
    205

    Macro to Fill Cells with H if it is a Friday or a Saturday

    Hello All,
    I am using Excel 2010.

    I have many sheets about 30+ (Sample data attached)
    Data is in B14:AF25 - see bordered area
    I want a macro which should run on all the Sheets and put H for dates falling on Fridays and Saturdays for all months in the current year

    It should put H in green color in Cells which are Fridays and Saturdays (Highlighted for month of August only)

    If the month is 28 days eg Feb then it should fill the cells 29, 30 and 31 with Red Color
    It should fill Red in the Cells according to the days in a month - Filled Red in the sample

    Any help would be appreciated
    TIA
    Rashid Khan
    Last edited by prkhan56; 08-31-2014 at 03:24 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Macro to Fill Cells with H if it is a Friday or a Saturday

    Hi

    You'll need to use WEEKDAY for this, it will return the day of the week as a number, then you can do the Friday and Saturday thing.

    I'd use formula based conditional formatting for your extra days past 28th or 30th, also you are not doing the 29th Feb every year, so this would be better to calculate the last day, EOMONTH

    There will be a load of articles on the net for looping through worksheets and looping through cells.

    Cheers
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Contributor
    Join Date
    06-03-2004
    Location
    India
    MS-Off Ver
    2013
    Posts
    205

    Re: Macro to Fill Cells with H if it is a Friday or a Saturday

    How to use both.

    Would you guide me with steps on my sample data file attached please?
    Thanks

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Macro to Fill Cells with H if it is a Friday or a Saturday

    Google it, sorry, this will explain how to do what you want.

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Macro to Fill Cells with H if it is a Friday or a Saturday

    hi Rashid, option, please check attachment, press Run button or run code "test"(ALT+F8,select "test", press Run)

    I assume it's for the current year. It's done for the one sheet only for now.

  6. #6
    Forum Contributor
    Join Date
    06-03-2004
    Location
    India
    MS-Off Ver
    2013
    Posts
    205

    Re: Macro to Fill Cells with H if it is a Friday or a Saturday

    Thanks please.
    Works like a charm.
    Now how can I make it run through all sheets in the Workbook please.
    Thanks once again.
    Rashid

  7. #7
    Forum Contributor
    Join Date
    06-03-2004
    Location
    India
    MS-Off Ver
    2013
    Posts
    205

    Re: Macro to Fill Cells with H if it is a Friday or a Saturday

    Hi,
    I found a code on the net and your code runs on all the Sheets in the workbook.
    Thanks a lot for your time and help
    Rashid

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 01-06-2014, 09:48 PM
  2. Count number of days minus Friday and or Saturday
    By aj34321 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-21-2013, 06:22 PM
  3. How do I set NETWORKDAYS to regard friday and saturday as weekend
    By Shay.C. in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-10-2006, 03:29 AM
  4. [SOLVED] Starting work period on a Saturday and ending on a friday
    By JLyons in forum Excel General
    Replies: 1
    Last Post: 02-18-2005, 10:06 AM
  5. [SOLVED] Starting work period on a Saturday and ending on a friday
    By JLyons in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-18-2005, 10:06 AM

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