+ Reply to Thread
Results 1 to 3 of 3

Moving an array formula to VBA only, with memory?

  1. #1
    Registered User
    Join Date
    05-19-2022
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    15

    Moving an array formula to VBA only, with memory?

    Good morning,
    I have this array formula that's listed down a column C2:C69.

    Please Login or Register  to view this content.
    It checks a two different columns for matching references, and if both match, then it returns the VLOOKUP value for the one that matches both references.

    Currently, obviously, the formula runs in each of the 68 cells down the column. C2 starts with the above formula and is repeated down until it stops in C69.

    It does a great job. However, is there a way to run this automatically in VBA when there's matching references instead?

    For example, the array formula at cell C15 has a value that's returned blank because currently there's no matching references for the VLOOKUP. However, I'd like to be able to manually enter a value, say "123456" into cell C15. While C15 = 123456, if ever there's a time where there is a matching reference that would be returned in C15 instead, I want it to overwrite what's currently written into cell C15. Overwriting indiscriminately is not really ideal, so in addition, is it possible in VBA for it to "remember" the manually entered value and store it, then if the value from the VLOOKUP is blank, it'll return the original manually entered value in its place from storage? Does that make sense?


    I do have simpler solution to accomplish the same thing, but the way we'd use the file, it becomes kind of an issue. There'd be a lot of very specific protections we'd have to make to ensure folks don't break the file. None of them know how to open the VBA editor to mess that up.

    It's for a dock schedule. I want the cells to automatically return a Trailer # that's recorded in Workbook2, but sometimes there's trailers that we place at locations that are not being recorded and instead need entered manually, but should be overwritten if there's ever something assigned to that location instead.
    Last edited by Tree310; 05-20-2022 at 05:22 PM. Reason: Solution found

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Moving an array formula to VBA only, with memory?

    Could you not put your manual entry into a different column? E.g. put "123456" into cell Z15 and change your formula:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Registered User
    Join Date
    05-19-2022
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    15

    Re: Moving an array formula to VBA only, with memory?

    Quote Originally Posted by WideBoyDixon View Post
    Could you not put your manual entry into a different column? E.g. put "123456" into cell Z15 and change your formula:

    Please Login or Register  to view this content.
    WBD
    That's actually a great solution that I prefer over the VBA. Thank you!

+ 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. VLOOKUP searching array in memory
    By mwc0914 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-19-2018, 08:09 PM
  2. [SOLVED] Thrashing VBA Memory Leaks. Memory Loop Problems. Uncleared Memory in .Match Range Object
    By Doc.AElstein in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-10-2017, 05:17 PM
  3. Memory size of an object like array
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-18-2017, 06:13 AM
  4. [SOLVED] VBA: Vlookup / Match on Array in memory
    By JasperD in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-12-2016, 05:06 PM
  5. Out of Memory when i make array
    By morpheus305 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-13-2009, 10:27 PM
  6. [SOLVED] Out of Memory: Array Transpose
    By TheVisionThing in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-01-2005, 04:06 PM
  7. [SOLVED] RTD w/Array Formula fails when moving to new PC
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-19-2005, 03:06 PM

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