+ Reply to Thread
Results 1 to 2 of 2

Parent Child Variables & Selecting Info from an Excel Sheet

  1. #1
    Registered User
    Join Date
    02-13-2017
    Location
    Georgia
    MS-Off Ver
    Office 2016
    Posts
    4

    Parent Child Variables & Selecting Info from an Excel Sheet

    Hello All,
    I have been tasked with creating a macro that will ultimately take some user input, decide what type of building to build, and select certain materials. As such, I need some help on a few things. I am new to the forum and to VBA so please be kind.

    Step 1: User selects the type of building:

    Sub Parent()
    Type = InputBox("Type '1' for building type 1. Type '2' for building type 2.")

    If Type = 1 Then
    Child1()

    ElseIf Type = 2
    Child2()
    End If

    End

    Step 2: User inputs info relevant to the building type:
    Sub Child1()
    Length = InputBox("Input the length of the building.")
    Width = InputBox("Input the width of the building.")
    Heigth = InputBox("Input the Height of the building.")

    Call Subchild1

    Step 3: Calculations done and macro selects best option based off (3) columns of data from a specific worksheet. (this is where I am running into issues).

    Sub Subchild1()
    X = length^.5
    Y = Width/15
    Z = (Height*Length*Width)/27

    Now i need something to do the following: In worksheet, find the lowest value in column A, that also has a value greater than or equal to 'X' in column B, and ALSO greater than or equal to 'Z' in column C. I have researched and see there are ways to set Ranges, and FindMin, and IIF statements, but i am unsure how to make them work together to search several columns in a worksheet. I am also having issues calling variables from a parent routine to a child subroutine.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Parent Child Variables & Selecting Info from an Excel Sheet

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ 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. [SOLVED] Looking up all the child values associated with one parent value
    By cwwazy in forum Excel General
    Replies: 7
    Last Post: 08-03-2015, 04:09 PM
  2. [SOLVED] Parent child relationships(working out parent item) for each item
    By grphillips in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-21-2013, 05:58 AM
  3. Parent Child Relationship
    By Automation Guru in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-02-2013, 04:48 AM
  4. Vba code for Parent child
    By ken4ward in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-06-2012, 06:04 AM
  5. Child excel sheet inherits parent sheet
    By oetijr02 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2012, 02:57 PM
  6. Replies: 3
    Last Post: 07-09-2010, 02:54 PM
  7. [SOLVED] Sorting Parent Child
    By kcmtnbiker in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-30-2006, 09:00 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