+ Reply to Thread
Results 1 to 8 of 8

VBA Macro to take list of multiple inputs, apply to another spreadsheet, and return value

  1. #1
    Registered User
    Join Date
    09-21-2013
    Location
    west lebanon, nh
    MS-Off Ver
    Excel 2013
    Posts
    4

    VBA Macro to take list of multiple inputs, apply to another spreadsheet, and return value

    I want to create a macro to take multiple inputs from sheet 2, apply them simultaneously to the inputs on sheet 1, take sheet 1's output and list next to the inputs on sheet 2. I want to apply this to a spreadsheet with complicated calculations. Example spreadsheet attached. Related Macros I have will do a similar thing but only take one input at a time. Code as follows. Can anyone help me adapts this code.

    Sub x()

    Dim r As Range

    With Sheet2
    For Each r In .Range("A2", .Range("A2").End(xlDown))
    Sheet1.Range("A2") = r
    r.Offset(, 2).Resize(, 3).Value = Sheet1.Range("C2:E2").Value
    Next r
    End With

    End Sub
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: VBA Macro to take list of multiple inputs, apply to another spreadsheet, and return va

    Why not just make the formula on sheet 2 (and dragd down).

    See the attached file.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    09-21-2013
    Location
    west lebanon, nh
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: VBA Macro to take list of multiple inputs, apply to another spreadsheet, and return va

    ]The actual spreadsheet is much more complex. Lots of conditional statements involved in the calculations so can't drag down. The actual problem is attached. Same set up.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Macro to take list of multiple inputs, apply to another spreadsheet, and return va

    Is this what you wanted?
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-21-2013
    Location
    west lebanon, nh
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: VBA Macro to take list of multiple inputs, apply to another spreadsheet, and return va

    No, the output on sheet2 F3 should be equal to the value in sheet 1 C1 when all three prices B3:D3 from sheet 2 are entered into C6:E6 on sheet 1.

  6. #6
    Registered User
    Join Date
    09-21-2013
    Location
    west lebanon, nh
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: VBA Macro to take list of multiple inputs, apply to another spreadsheet, and return va

    Was just solved on another forum. Go here. http://www.ozgrid.com/forum/showthre...goto=newpost**

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Macro to take list of multiple inputs, apply to another spreadsheet, and return va

    The same code, but may be slightly faster on massive data.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: VBA Macro to take list of multiple inputs, apply to another spreadsheet, and return va

    @derickjones

    Thanks for sharing the solution, you've been given on another forum.

    Please Login or Register  to view this content.
    But see the messege below.

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

+ 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. Replies: 0
    Last Post: 06-16-2013, 10:46 AM
  2. Macro required to generate recurring list using frequency and calendar inputs
    By rowlandrat in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-10-2011, 05:28 AM
  3. Using a macro to disable inputs from multiple sources
    By DianeElmes in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-27-2010, 07:01 AM
  4. Populating a list with a macro based on inputs
    By AbeBorker in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-28-2009, 04:15 PM
  5. Multiple cell address inputs to a macro
    By chanteur in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2007, 05:07 PM

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