+ Reply to Thread
Results 1 to 4 of 4

Convert this IF and MIN formula into VBA

  1. #1
    Registered User
    Join Date
    11-26-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    95

    Convert this IF and MIN formula into VBA

    Hi
    I'm trying to convert the following formula into VBA
    '=IF(F35>F30,MIN((F35-F30),E30),0)

    I have written the following code but 'iLimit is Blank when I step through the code. a, z and i as numbers in a textbox on a userform.
    I have also tried Dim iLimit as a Variant too.

    If I hover over a, z, i it shows the correct values. Its the iLimit that is not working. I think its the IF function??

    Please Login or Register  to view this content.

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

    Re: Convert this IF and MIN formula into VBA

    There is no WorksheetFunction.If, either use Evaluate or use VBA's own If.

    If you are using textboxes I would recommend the latter, can you post the textbox names and outline their relationship?
    If posting code please use code tags, see here.

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: Convert this IF and MIN formula into VBA

    An option:
    Please Login or Register  to view this content.
    Another:
    Please Login or Register  to view this content.
    Ben Van Johnson

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Lightbulb

    Hi !

    Quote Originally Posted by mtilbury View Post
    I'm trying to convert the following formula into VBA
    '=IF(F35>F30,MIN((F35-F30),E30),0)
    PHP Code: 
        iLimit Evaluate("IF(F35>F30,MIN((F35-F30),E30),0)"
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

+ 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] Convert formula to VBA code without viewing the formula in Cell
    By KumarPK in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-24-2016, 11:02 AM
  2. Replies: 8
    Last Post: 09-29-2016, 08:21 AM
  3. Convert Cell Formula to Convert Text to VBA Code
    By PY_ in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-08-2014, 05:51 PM
  4. Formula as text in cell -> convert to formula result
    By AHFoddeR in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-12-2013, 02:00 AM
  5. [SOLVED] Need to Convert Formula R1C1 into A1-style but the Formula String exceeds 255 characters
    By VBA_Gary in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-04-2012, 12:09 PM
  6. Replies: 3
    Last Post: 05-18-2010, 06:14 AM
  7. [SOLVED] how to convert a formula into text in order to display the formula
    By Claudio Hartzstein in forum Excel General
    Replies: 2
    Last Post: 07-13-2006, 05:05 AM

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