+ Reply to Thread
Results 1 to 8 of 8

Replace ARRAY formula with VBA code

  1. #1
    Forum Contributor MariaPap's Avatar
    Join Date
    10-19-2013
    Location
    Chania-Crete-Greece
    MS-Off Ver
    Excel 2003-2010
    Posts
    319

    Replace ARRAY formula with VBA code

    Hello

    I use this ARRAY formula in a sheet and then i get the result in a textbox of a userform.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I am wondering how can i replace this formula with a macro-code as my application started to be slow, using this. Let's say that the value of cell ae2, I'll get from textbox1 and the result should be in textbox2.

    Any idea for this?

  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: Replace ARRAY formula with VBA code

    Hi,

    It will be slow because you are covering 29000 + rows. Is that necessary?
    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 MariaPap's Avatar
    Join Date
    10-19-2013
    Location
    Chania-Crete-Greece
    MS-Off Ver
    Excel 2003-2010
    Posts
    319

    Re: Replace ARRAY formula with VBA code

    Unfortunately yes.

    That's why i thought that a macro will works faster.

  4. #4
    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: Replace ARRAY formula with VBA code

    Hi,

    Can you explain what you are trying to do. There may well be a non array function solution.
    Attach a small example workbook along with some notes as to what you're attempting to do and manually add some calculated results.

  5. #5
    Forum Contributor MariaPap's Avatar
    Join Date
    10-19-2013
    Location
    Chania-Crete-Greece
    MS-Off Ver
    Excel 2003-2010
    Posts
    319

    Re: Replace ARRAY formula with VBA code

    Thank you for looking at this.

    I prepared a small example to see what i do.
    Attached Files Attached Files

  6. #6
    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: Replace ARRAY formula with VBA code

    Hi,

    You've succesfully uploaded the workbook but have not said what the aim is and added some manually calculated results - as asked for.
    As it stands I have no idea what your process is supposed to achieve apart from making something faster, but of course being a small file it will not be slow anyway.

    I need to know exactly what you DO, i.e. data entry, values and results.

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Replace ARRAY formula with VBA code

    Give a try to this Maria. It's gives the results that you want(i added reults for amounts in textbox2) in your example sheet. I hope-think that will be faster(than the way that you already have) in your original workbook.
    Please Login or Register  to view this content.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  8. #8
    Forum Contributor MariaPap's Avatar
    Join Date
    10-19-2013
    Location
    Chania-Crete-Greece
    MS-Off Ver
    Excel 2003-2010
    Posts
    319

    Re: Replace ARRAY formula with VBA code

    Thank you again Mr Foti.Excellent! More than 50% faster than the way that i used.

+ 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. Macro which replace large array formula
    By ALEZI in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-22-2014, 02:32 PM
  2. [SOLVED] Formula to replace this array
    By cboys00 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-06-2012, 08:47 PM
  3. [SOLVED] Array Formula vs vBa code - How To Modify My Messy Code To One Of Those
    By ScotyB in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-20-2012, 12:04 AM
  4. Replace hard coded array in formula with link to input array
    By David Brown in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-08-2011, 07:45 AM
  5. Code to replace Formula
    By Corey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-03-2006, 09:15 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