+ Reply to Thread
Results 1 to 3 of 3

Convert Excel function into VBA code

  1. #1
    Registered User
    Join Date
    09-28-2019
    Location
    India
    MS-Off Ver
    MS office 2007
    Posts
    31

    Red face Convert Excel function into VBA code

    Hello everyone,
    I am new to this forum ..
    I am having excel formula which is taking alot of time to load that sheet...
    So I now want to convert that formula and function in VBA code... As i am new to VBA coding,... Please Help me to solve my query
    Below is the formula:-
    =IF(ISERROR(INDEX($A$1:$C$1000,SMALL(IF($A$1:$A$1000=$R$2,ROW($A$1:$A$1000)),ROW(1:1)),3)),"",INDEX($A$1:$C$1000,SMALL(IF($A$1:$A$1000=$R$2,ROW($A$1:$A$1000)),ROW(1:1)),3))

    Please Help!
    Thank You in Advance...

  2. #2
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Convert Excel function into VBA code

    (Sorry about my English)

    Could you please chang your formula to

    =IFError(INDEX($A$1:$C$1000,SMALL(IF($A$1:$A$1000=$R$2,ROW($A$1:$A$1000)),ROW(1:1)),3),"")

    This may reduce calculation time by half.

    Regards.

  3. #3
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Convert Excel function into VBA code

    It snot clear what you want as a function. Vba functions will run more slowly than formulas on a sheet.
    If results ae static you can have the formula, calculate and then paste as values so it no longer needs to be calculated. You could do a keystrock macro to reinsert the formual if they need to be updated

    https://trumpexcel.com/suffering-fro...-spreadsheets/

+ 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. Convert Substitute Function in Excel to VBA code
    By clark153 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-15-2019, 01:53 PM
  2. Convert Excel Code to Access Code
    By Ruseju in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-17-2016, 02:36 AM
  3. VBA code to convert excel file to .txt
    By lbl159 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-26-2015, 03:15 PM
  4. Need help to convert windows excel vba code to run on mac osx
    By lethanhtrung in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 5
    Last Post: 06-24-2015, 05:18 AM
  5. [SOLVED] Convert nested if function to vba code
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-31-2015, 09:56 AM
  6. [SOLVED] Convert a fixed function (hard code row number) with embedded functions to last Row Functi
    By markDuffy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-05-2013, 12:47 PM
  7. [SOLVED] how to convert the vlookup function to vba code
    By funtastic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-04-2012, 06:50 PM

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