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.
Bookmarks