In this article, we have used a Goal Seek to get required minimum sales to meet the Sales % target using VBA. You can use this method for other purpose also.
Input your number in left table and yellow highlighted field and click on GetMinimum Sales button.
Watch this step by step video to Goal Seek using VBA-
Below is the macro code –
Option Explicit Sub Goal_Seek() Dim sh As Worksheet Set sh = ThisWorkbook.Sheets("Goal Seek") sh.Range("K13").GoalSeek goal:=sh.Range("E5").Value, changingcell:=sh.Range("G10") sh.Range("G10").NumberFormat = "0" End Sub