This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Reset_External_Marks() | |
'Select the external marks range | |
Range("E5:E13").Select | |
'Clear the external marks range | |
Selection.ClearContents | |
End Sub | |
Sub Goal_Seek_Range_MultipleGoal() | |
'Defining variable k | |
Dim k As Integer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Goal_Seek_Range_SingleGoal() | |
'We are looping through each row in our table | |
For j = 5 To 13 | |
'Below is how we replicate the Goal Seek functionality via VBA | |
'Cells(j, "F").GoalSeek - The cell that will hold our Goal value (in this case, Col F) | |
'Goal:=Cells(5, "H") - The value of our goal. In this case its referencing the value of Cell H5 | |
'ChangingCell:=Cells(j, "E") - The input cell that needs to adjust its value inorder to achieve the goal | |
Cells(j, "F").GoalSeek Goal:=Cells(6, "H"), ChangingCell:=Cells(j, "E") | |
'Go to next iteration | |
Next j |