acorneliuz1213
New Member
- Joined
- Feb 24, 2023
- Messages
- 1
- Office Version
- 365
- 2021
- Platform
- Windows
Need help with loop, the second Range("AA"..... line needs to be debugged, error message says reference isn't valid. Note i have changed the .Select to .Address and also removed it but it still doesn't work.
Sub GoalSeek_limited()
'
' GoalSeek_limited Macro
'
'
Dim i As Long
For i = 2 To 200
Range("AA" & i).Select
Application.CutCopyMode = False
Application.CutCopyMode = False
Application.CutCopyMode = False
Range("AA" & i).GoalSeek Goal:=0.04, ChangingCell:=Range("W" & i).Select
Next
End Sub
-------------------------------
DATA SET:
W X Y Z AA
$6.29 $0.50 $6.79 -68.0%
currently trying to have the macro automate a 4% in AA by plugging in a number in W. I have a ton of data with line breaks all in one tab.
Sub GoalSeek_limited()
'
' GoalSeek_limited Macro
'
'
Dim i As Long
For i = 2 To 200
Range("AA" & i).Select
Application.CutCopyMode = False
Application.CutCopyMode = False
Application.CutCopyMode = False
Range("AA" & i).GoalSeek Goal:=0.04, ChangingCell:=Range("W" & i).Select
Next
End Sub
-------------------------------
DATA SET:
W X Y Z AA
$6.29 $0.50 $6.79 -68.0%
currently trying to have the macro automate a 4% in AA by plugging in a number in W. I have a ton of data with line breaks all in one tab.