S
Sharon
I am just a novice & wrote a simple do loop for goal seeking. The goal seek
calculates however, the macro won't End Sub. The debugging highlights the
3rd to the last line below : Cells(81, i).GoalSeek Goal:=0,
ChangingCell:=Cells(74, i)
Sub GoalSeek()
'select/copy values
Range("AY79:BJ79").Copy
Range("AY76:BJ76").Select
Selection.PasteSpecial Paste:=xlValues
'set variables
Dim r As Integer, i As Integer
'assign column value to varibles
r = 50
i = 0
Cells(81, r).Select
Do
r = r + 1
Loop Until Cells(81, r) = "end"
For i = 51 To r
'goal seek
'set cell range (row 81) to 0 by adjusting 100% (row 74)
Cells(81, i).GoalSeek Goal:=0, ChangingCell:=Cells(74, i)
Next i
End Sub
calculates however, the macro won't End Sub. The debugging highlights the
3rd to the last line below : Cells(81, i).GoalSeek Goal:=0,
ChangingCell:=Cells(74, i)
Sub GoalSeek()
'select/copy values
Range("AY79:BJ79").Copy
Range("AY76:BJ76").Select
Selection.PasteSpecial Paste:=xlValues
'set variables
Dim r As Integer, i As Integer
'assign column value to varibles
r = 50
i = 0
Cells(81, r).Select
Do
r = r + 1
Loop Until Cells(81, r) = "end"
For i = 51 To r
'goal seek
'set cell range (row 81) to 0 by adjusting 100% (row 74)
Cells(81, i).GoalSeek Goal:=0, ChangingCell:=Cells(74, i)
Next i
End Sub