I am making a prototype worksheet that follows 9 step problem solving procedure.
Some improvements I'm considering would be to iterate over some of it instead of making a new code line for every single variant. More or less I need to optimize this code so I can learn how to do this type of thing in the future.
It's not a very straight looping process and I can't think of any good ways to set it up.
Here is a picture of the sheet that the values will go into.
Here is my code
Sub nine_Step()
Dim step1, step2, step3, step4a, step4b, step4c, step4d, step4e, step5a, step5b, step5c, step5d, step5e, step6a, step6b, step6c, step6d, step6e, step7, step8, step9 As Variant
step1 = InputBox("Step 1: Define the Problem.")
Cells(2, 3).Value = step1
step2 = InputBox("Step 2: What is the Measured Actual Value?")
Cells(4, 3).Value = step2
step3 = InputBox("Step 3: What is the Target Value Desired?")
Cells(6, 3).Value = step3
If step3 <> "" Then
Cells(7, 3).Value = step3 - step2
Else:
End If
step4a = InputBox("Step 4: Why is " & step1 & " happening?")
Cells(9, 3).Value = step4a
step4b = InputBox("Step 4: Why is " & step4a & " happening?")
Cells(10, 3).Value = step4b
step4c = InputBox("Step 4: Why is " & step4b & " happening?")
Cells(11, 3).Value = step4c
step4d = InputBox("Step 4: Why is " & step4c & " happening?")
Cells(12, 3).Value = step4d
step4e = InputBox("Step 4: Why is " & step4d & " happening?")
Cells(13, 3).Value = step4e
step5a = InputBox("Step 5: Describe your First Possible Solution")
Cells(15, 3).Value = step5a
step5b = InputBox("Step 5: Describe your Second Possible Solution")
Cells(16, 3).Value = step5b
step5c = InputBox("Step 5: Describe your Third Possible Solution")
Cells(17, 3).Value = step5c
step5d = InputBox("Step 5: Describe your Fourth Possible Solution")
Cells(18, 3).Value = step5d
step5e = InputBox("Step 5: Describe your Fifth Possible Solution")
Cells(19, 3).Value = step5e
step6a = InputBox("Step 6: Experiment Measurement Results Solution 1")
Cells(21, 3).Value = step6a
step6b = InputBox("Step 6: Experiment Measurement Results Solution 2")
Cells(22, 3).Value = step6b
step6c = InputBox("Step 6: Experiment Measurement Results Solution 3")
Cells(23, 3).Value = step6c
step6d = InputBox("Step 6: Experiment Measurement Results Solution 4")
Cells(24, 3).Value = step6d
step6e = InputBox("Step 6: Experiment Measurement Results Solution 5")
Cells(25, 3).Value = step6e
step7 = InputBox("Step 7: When did you impliment a solution? Enter a date in
XX/XX/XXXX format")
If step7 = "" Then
MsgBox ("Find out when you implimented a solution and enter it when you get a chance.")
Else:
Cells(28, 3).Value = step7
End If
step8 = InputBox("Step 8: Now that the solution is implemented perminently, what is the current measurement?")
Cells(31, 3).Value = step8
If step8 <> "" Then
Cells(32, 3).Value = Cells(6, 3).Value - step8
Else:
End If
step9 = InputBox("Step 9: Any other Ideas that have sprung up since you have started this nine step related to this area?")
Cells(34, 3).Value = step9
MsgBox ("You have successfully completed this 9 Step. Congrats!")
End Sub