+ Reply to Thread
Results 1 to 6 of 6

Add Values to New Tables Based on Cell Value in Table 1

  1. #1
    Registered User
    Join Date
    10-14-2015
    Location
    East Coast
    MS-Off Ver
    2013
    Posts
    69

    Add Values to New Tables Based on Cell Value in Table 1

    Hey All,

    So I have an interesting challenge here (worksheet is attached). I'd like to write a macro that looks at Table 1, and based off of a cell value in a given row in that table, add certain values to a different table from that row. This macro should be activated by a button.

    The example worksheet attached is an example of how the worksheet should look after the macro has been executed. My actual data has a couple thousand rows, and would need this functionality a couple of times per week.

    But based off of my example sheet macro should:
    - Look at System column in the top table
    - For risks associated with system 1, copy the Unique ID, Probability, and Consequences to a new row in the System 1 table
    - For risks associated with system 2, copy the Unique ID, Probability, and Consequence to a new row in the System 2 table

    Thanks everyone!

    Best,
    Chris
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Add Values to New Tables Based on Cell Value in Table 1

    Try
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by jindon; 10-23-2015 at 09:42 PM. Reason: File replaced

  3. #3
    Registered User
    Join Date
    10-14-2015
    Location
    East Coast
    MS-Off Ver
    2013
    Posts
    69

    Re: Add Values to New Tables Based on Cell Value in Table 1

    That's awesome!!! Any way I can just get the tables to update to an existing sheet instead of creating a new one for each update though?

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Add Values to New Tables Based on Cell Value in Table 1

    change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    replace SheetNameHere with sheet name that you want to output to.
    [/code]

  5. #5
    Registered User
    Join Date
    10-14-2015
    Location
    East Coast
    MS-Off Ver
    2013
    Posts
    69

    Re: Add Values to New Tables Based on Cell Value in Table 1

    Almost works. However, when you start to add or subtract more rows from table 1 it starts to return incorrect values from incorrect columns.

    Is there any way to just run a loop through table 1 to look for the system name, and return the unique id, probability, and consequence from that row to a predetermined table (i.e. if i created a "System 1" table, then values from table 1 for System 1 would be returned to that table)?

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Add Values to New Tables Based on Cell Value in Table 1

    Upload a file that you are talking about.

+ 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. VBA: Filter Pivot Table based on cell values
    By nicklasj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-31-2015, 11:16 AM
  2. Look at multiple criterias to see if table values match values of other tables
    By gaudi93080 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-15-2014, 06:45 PM
  3. [SOLVED] Return table of values based off of one cell value
    By knguyen777 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-22-2013, 12:55 PM
  4. Creating a List from a Table, based on Cell Values
    By Dan86 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-28-2013, 06:01 PM
  5. based on certain criteria, need to get cell values from table
    By anand_erin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-07-2012, 12:56 AM
  6. Copying data to a table based on cell values
    By Miraun in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-27-2011, 09:19 AM
  7. VBA Code - Changing filters of several pivot tables based on cell values
    By kriskrispies in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-14-2010, 08:49 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