+ Reply to Thread
Results 1 to 4 of 4

Post formula in VBA with date reference

  1. #1
    Registered User
    Join Date
    01-30-2020
    Location
    UK
    MS-Off Ver
    2013
    Posts
    82

    Post formula in VBA with date reference

    Please Login or Register  to view this content.
    I need the second countif criteria to be less than or equal to the d1 reference but I can't get it quite right. Any help appreciated!

  2. #2
    Valued Forum Contributor
    Join Date
    01-14-2013
    Location
    Austria
    MS-Off Ver
    2016 / 2019
    Posts
    339

    Re: Post formula in VBA with date reference

    Please Login or Register  to view this content.
    you forgot to use the "&" before d1

    What is the reason why you use "external:=True, ReferenceStyle:=Application.ReferenceStyle". This makes the formula more unreadable.

    cheers

  3. #3
    Registered User
    Join Date
    01-30-2020
    Location
    UK
    MS-Off Ver
    2013
    Posts
    82

    Re: Post formula in VBA with date reference

    Hi gue2013, it was advice given on my previous question about formulas in VBA. Can it be ditched then?

    Cheers

  4. #4
    Valued Forum Contributor
    Join Date
    01-14-2013
    Location
    Austria
    MS-Off Ver
    2016 / 2019
    Posts
    339

    Re: Post formula in VBA with date reference

    There are a few reasons why you could use them somewhere but not in your case.

    external:=True - gives you (additionally to the worksheet name) the name of the workbook. Your formula is for your workbook and you know the name.
    ReferenceStyle:=Application.ReferenceStyle --> this will be a problem if your application is set to xlR1C1 style and not to xlA1.

    The best is always to test the formula directly on a sheet and then to build the string in VBA.

+ 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. Formula required to reference date range
    By ettyenn in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-25-2019, 03:09 PM
  2. [SOLVED] Formula help - Find date in table and reference value
    By OilAndGasMan1984 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-30-2019, 05:09 PM
  3. [SOLVED] Needed date validity reference formula
    By ipn in forum Excel General
    Replies: 1
    Last Post: 05-18-2017, 03:58 AM
  4. VBA Date Reference to Date Then Insert Row Based On Cell Reference
    By surfstar in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-08-2014, 11:21 AM
  5. [SOLVED] Formula to Sum 12 Cells Leading Up to Reference Date
    By investmentbanker in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-25-2013, 05:43 PM
  6. How to reference cell with date in formula
    By 4lilprinces in forum Excel General
    Replies: 6
    Last Post: 12-19-2012, 06:20 PM
  7. Date reference in formula
    By kmhoppes in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-04-2010, 02:26 PM

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