+ Reply to Thread
Results 1 to 4 of 4

Convert Formula to VBA

  1. #1
    Registered User
    Join Date
    02-12-2016
    Location
    Montreal
    MS-Off Ver
    2010
    Posts
    23

    Convert Formula to VBA

    Hi folks!

    I have a formula that i'm trying to convert into VBA.

    Formula =INDEX(Jobs!$G:$M;IFERROR(MATCH("HoF*"&$C$7;Jobs!$B:$B&Jobs!$C:$C;0);MATCH($C$7;Jobs!$C:$C;0));1)

    Anyone can help me on this please.

    Thank you in advance

  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,428

    Re: Convert Formula to VBA

    What do you mean by "I have a formula that i'm trying to convert into VBA."?

    First question: Why? Second question: Where is the output to go? third question: Do you just want values; is this for performance?

    It looks like an Array Formula with full column references so performance is likely to be poor. Use Dynamic Named Ranges or a Structured Table to minimise the number of cells involved in the calculations.
    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
    Registered User
    Join Date
    02-12-2016
    Location
    Montreal
    MS-Off Ver
    2010
    Posts
    23

    Re: Convert Formula to VBA

    Sorry about the confusion...

    Where is the output to go? The formula is now sitting in (Custom) sheet at the cell (C10).

    The formula now in it is =INDEX(JobsStats;IFERROR(MATCH("HoF*"&$C$7;JobsBatchNo&Jobs;0);MATCH($C$7;Jobs;0));5)

    Why? Because in VBA with other condition... the cell formula might change or even not be any formula. Less confusion with formula and also easyer to manage.

    Do you just want values; is this for performance? To show value in cell... yes... to perform faster... yes.

  4. #4
    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,428

    Re: Convert Formula to VBA

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

+ 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

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