+ Reply to Thread
Results 1 to 4 of 4

VBA test to determine if cell has a formula or value

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,712

    VBA test to determine if cell has a formula or value

    Hi,

    I need to take a specific action when a cell has an actual formula in it versus when it just has a "value". Is there a procedure or command which will allow me to identify if a certain cell has a "formula" (like =sum(a1: a5) ) or just a value.
    Last edited by welchs101; 12-28-2008 at 10:18 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    The VBA instruction
    Please Login or Register  to view this content.
    will return whatever's in A1, and hence you could use an IF instruction to test the first character. i.e.

    Please Login or Register  to view this content.
    HTH

  3. #3
    Forum Contributor
    Join Date
    06-14-2008
    Posts
    153
    Hi,

    Check for HasFormula property, for example:
    Please Login or Register  to view this content.
    Regards.
    Welcome to: http://www.exceldigest.com/myblog/
    "Excel help for the rest of us"

  4. #4
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,712
    Thanks Richard and SE ........both of these are good inputs. Thanks!

+ Reply to 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