+ Reply to Thread
Results 1 to 6 of 6

How to automatically loop values into a formula and place in new sheet

  1. #1
    Registered User
    Join Date
    06-05-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    13

    How to automatically loop values into a formula and place in new sheet

    I am attempting to pull four values from four different sheets, and plug it into a formula. Then, send the result of the formula into another sheet.

    I've attached a mock-up of the workbook that resembles the actual sheets I need to pull data from.

    For example, I essentially need to take each sheet's "A2" cell value and plug it into a formula (probably using an Evaluate function?). Then, send the result of the formula into another sheet's "A2" cell, and repeat with A3, A4...B2, B3...,etc.

    I have the function and know how to plug values into it - I just need help to figure out how to essentially "loop" through all the values in the sheet(s) and get them into a sheet with all the results.

    In the actual data, there is text prior to the data starting, so I would be helpful if I could set bounds on which cells are plugged into the formula. For example (using the attached sheet), if I could bound the formula to only being applies to cells in rows 2-10 and columns A-D.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: How to automatically loop values into a formula and place in new sheet

    Can you show the formula(s) and the results?
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    06-05-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    13

    Re: How to automatically loop values into a formula and place in new sheet

    Please Login or Register  to view this content.
    Here is my attempt, but the last line is incomplete. WSR is the page where I want the results to go. The theta and alpha variables are created based on user input, and already calculated in an earlier part of the code.


    Thanks for help in advance!

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: How to automatically loop values into a formula and place in new sheet

    Please Login or Register  to view this content.
    You're only populating one column in the output table and I don't see where t1a1p is defined.

    I think you want this...

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-05-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    13

    Re: How to automatically loop values into a formula and place in new sheet

    I figured it out! Thanks for your help!
    Last edited by kcombs; 08-29-2018 at 09:37 AM. Reason: Fixed issue with VBA code

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: How to automatically loop values into a formula and place in new sheet

    As a test, use this to show that you are populating the array with something and then applying it to the sheet.

    Please Login or Register  to view this content.
    If that works, then the problem is with your Evaluate formula.

+ 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 Macro to copy values from one place to another in the sheet
    By chikki985 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 05-08-2018, 12:08 AM
  2. [SOLVED] Automatically place people in a crrespondeng sheet from an overview
    By dude1986 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-20-2018, 02:13 PM
  3. Get the SUM of identical values from one sheet and place it on another sheet
    By stoey in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-14-2014, 11:49 AM
  4. place values on the right date in another sheet
    By keis386 in forum Excel General
    Replies: 1
    Last Post: 08-10-2011, 07:42 AM
  5. Calculate values in one sheet and place result in another sheet
    By maximpinto in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2010, 07:15 AM
  6. Replies: 1
    Last Post: 07-20-2008, 02:22 PM
  7. automatically place the latest entry from a column into a formula
    By dakotasky in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-05-2006, 05:50 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