+ Reply to Thread
Results 1 to 5 of 5

Passing a fomula into a function

  1. #1
    Forum Contributor
    Join Date
    09-21-2012
    Location
    illinois
    MS-Off Ver
    Excel 2010
    Posts
    242

    Passing a fomula into a function

    Is there a way I can pass the formula i a cell into a function. Heres some backgoround of what I'm doing. I have a column that I want to perform a function where if another column has a formula. in it it will do one calculation if it dosent it will do another one.

  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

    Re: Passing a fomula into a function

    Hi,

    Are you wanting a standard Excel function or a User Defined (VBA) function?

    I don't know of any way of detecting whether a cell has a formula by just using Excel functions, but in VBA you can use the .HasFormula syntax.

    If you want an Excel function solution are there any other cells, on which the cell you're trying to check for the presence of a formula is dependent? If so perhaps you could use the independent cell and check its value in an IF() test.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    09-21-2012
    Location
    illinois
    MS-Off Ver
    Excel 2010
    Posts
    242

    Re: Passing a fomula into a function

    It would be a VBA function. I have it already written. My problem is that I have an entre row that this Function will be running in so for example I have this function in A5 through A20 I want it to run against column B in the adjacent cells so a 5 would go against B5.

  4. #4
    Forum Contributor
    Join Date
    09-21-2012
    Location
    illinois
    MS-Off Ver
    Excel 2010
    Posts
    242

    Re: Passing a fomula into a function

    This is my code the theing that is giveing me a problem is how I pull in what is in fomula in the cell not the Value in the cell.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    09-21-2012
    Location
    illinois
    MS-Off Ver
    Excel 2010
    Posts
    242

    Re: Passing a fomula into a function

    CAn anyone help

+ 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