Results 1 to 7 of 7

VBA code to populate a formula based on a table ( ID // Name)

Threaded View

  1. #1
    Registered User
    Join Date
    07-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2007
    Posts
    10

    VBA code to populate a formula based on a table ( ID // Name)

    Hello everyone,

    I've been trying to find a way to write a formula in vba but I only see stuff on how to insert a fixed formula,
    I'm trying to have a dynamically written formula by VBA


    The code would have to repeat a section of the formula [ ,IF(--NOT(ISERROR(SEARCH("for each project ID",H2))),"and each name", ]

    one after the other untill all projects are accounted for


    there may be up to a bunch of projects at a time but they will change often so that's why it needs to adjust to that.


    the first two arguments of the formula are

    =IF(A2=0,"",IF(--NOT(ISERROR(SEARCH("EXTRA",J2))),"EXTRA",

    followed by
    Something like

    IF(--NOT(ISERROR(SEARCH("first in list",H2))),"name1",IF(--NOT(ISERROR(SEARCH("Second in list",H2))),"name2",IF(--NOT(ISERROR(SEARCH("third in list",H2))),"name3",


    and so on until all projects are mentioned.


    with the final comma "false answer" being [ ,"Regular" ] if no project ID was found


    then to paste that in Column R of Sheet "LIVE ALL" (from R2 all the way down for each row of data on this sheet)


    The projects are written on a sheet called "Projects"

    Column A has an Sorting order number to help sort put the projects in order not to get false positives for incomplete matches.
    Column B has the project IDs
    Column C has the project names


    How would you approach this with VBA ?


    I have uploaded a sample Workbook you may download




    Thank you for your help and any guidance.
    Attached Files Attached Files
    Last edited by speedyacct; 09-22-2014 at 05:20 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to populate a table based on the searched values in a pivoted table
    By Kausty88 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2012, 06:11 AM
  2. Code/Macro to populate table based on user input.
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-08-2011, 07:50 AM
  3. VBA code to populate a table
    By roheba in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-02-2010, 11:26 AM
  4. Formula to Populate table based on 3 input values
    By Senthilerp in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-18-2009, 01:19 AM
  5. Populate Table 1 based on values in Table 2
    By Alan1981 in forum Excel General
    Replies: 5
    Last Post: 10-22-2007, 04:34 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