Hello,
I have the below code:
Sub GoalSeekMultipleCells()
Dim StartDate As Date
Dim Find As Range
Dim ReqSheet As Worksheet
Set ReqSheet = Worksheets("REQ SHEET")
StartDate = ReqSheet.Range("D1").Value
Set Find = ReqSheet.Range("A3:AH3").Find(What:=StartDate)
For p = 4 To 30
Cells(p, "t").ClearContents
If Cells(p, "x") < Range("X2").Value Then
On Error Resume Next
Cells(p, "t").Value = Cells(p, "i").Value * Range("X2").Value - Cells(p, "w").Value
Cells(p, "t").Value = Round(Cells(p, "t").Value, 0)
End If
Next p
End Sub
This code works fine in the set ranges of T4:T30, W4:W30, and X4:X30 but now I would like to make these ranges dynamic.
For example, based on the Date in D1, find that date in Row 3, and work in that area. Would this be possible using Offset?
Bookmarks