+ Reply to Thread
Results 1 to 4 of 4

Issue using VBA to add conditional formula

  1. #1
    Registered User
    Join Date
    09-03-2015
    Location
    Yorkshire
    MS-Off Ver
    2016 32bit
    Posts
    43

    Issue using VBA to add conditional formula

    Trying to use VBA to quickly add a conditional formula to a bunch of cells (If the column header is a particular week, apply formatting)


    I get run time error 1004 when I try, I don't understand why. Any help?


    Please Login or Register  to view this content.
    Cheers!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Issue using VBA to add conditional formula

    You'd say:
    Please Login or Register  to view this content.
    But, that said, it doesn't like the formula.

    If you typed the formula directly into the CF dialogue box, what would it be?

    You probably don't need to loop either
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Issue using VBA to add conditional formula

    I imagine you want Cells(r, c).Address rather than the value of the cell.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Issue using VBA to add conditional formula

    Does this work?
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    09-03-2015
    Location
    Yorkshire
    MS-Off Ver
    2016 32bit
    Posts
    43

    Re: Issue using VBA to add conditional formula

    Norie,

    That worked fine thankyou.

+ 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] Conditional formula argument limitation or other issue?
    By drew.j.harrison in forum Excel General
    Replies: 5
    Last Post: 07-14-2015, 08:12 PM
  2. Conditional Formatting Formula Issue
    By bldorris in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-11-2014, 03:43 PM
  3. [SOLVED] Conditional Formatting based on a Formula VBA Issue
    By lashellr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-10-2014, 11:58 AM
  4. [SOLVED] Issue with conditional formula
    By VincentX in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-07-2014, 03:10 PM
  5. [SOLVED] Issue with formula on conditional formatting
    By alchavar in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-25-2013, 01:38 PM
  6. [SOLVED] Conditional Formula Issue
    By belly247 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-24-2013, 05:24 AM
  7. [SOLVED] Conditional Formatting - formula issue
    By Bjordion in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-06-2012, 03:39 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