+ Reply to Thread
Results 1 to 7 of 7

Business Day through VBA on a range of cells

  1. #1
    Registered User
    Join Date
    07-01-2013
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    66

    Business Day through VBA on a range of cells

    Hi Experts,

    Quick and small help required. I googled quite a lot for this but was unable to find any.

    I want to input the Yesterday's Business Date on a range of cells say for E.g from column L2-L59.

    Two criteria's are important.

    1) Should be yesterday's business date. I.e. If today is 08/06/2014 then my the code should update as 08/05/2014. If i am running the code on a Monday, then it should update the date as friday.

    2) The range can vary. Today it might be from L2-L59, tomorrow it can be L2-L70.


    Can you please help.

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

    Re: Business Day through VBA on a range of cells

    Please Login or Register  to view this content.
    Surprised that you couldnt find that on google?
    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 Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Business Day through VBA on a range of cells

    hi aaron.mendes, option
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-01-2013
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    66

    Re: Business Day through VBA on a range of cells

    Hi watersev,

    Thanks. I inserted your code in my macro but somehow this is not working. Have i missed something or inputted a wrong function?

    My code is at the end just before the save as csv code begins. Please can you help.

    Please Login or Register  to view this content.

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

    Re: Business Day through VBA on a range of cells

    hi aaron, the code provided should reside in Sheet level and will not work in a standard module as it is an event code. If you do not want an event code (triggered by changing value in L column) the code should be rewritten

  6. #6
    Registered User
    Join Date
    07-01-2013
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    66

    Re: Business Day through VBA on a range of cells

    Hi Watersev - I'm an amateur in VBA and I am still learning to write codes. The above code that I pasted, is just a result of quite a lot of copy paste, trial and error and ofcourse google

    If the code has to be rewritten, would you please help.

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

    Re: Business Day through VBA on a range of cells

    please check attachment, press Run button or run code "test1"(ALT+F8, select "test1", Run)
    Attached Files Attached Files

+ 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. [SOLVED] Display only business days in date range formula?
    By 00pumpkin in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-20-2013, 01:59 PM
  2. Adding business days to a business day formula
    By snappytim in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-29-2013, 07:36 PM
  3. Replies: 1
    Last Post: 09-14-2012, 02:18 PM
  4. Last business day of month function +1,2,3,4 business days
    By dstock in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-21-2008, 06:08 PM
  5. WHERE CAN I GET A BUSINESS PROPOSAL OR A BUSINESS EXPENSE SHEET?
    By FELICITA ROSALES in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 08-18-2005, 05:27 PM

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