help with macro syntax

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

getting type mismatch error.

Sub goalsk()
Dim R As Long 'Row
For R = 4 To 16
Range("B" & R).GoalSeek goal:=0.42, ChangingCell:=Range("C" And R)
Next R
End Sub
 
replace:
Range("B" & R).GoalSeek goal:=0.42, ChangingCell:=Range("C" And R)
with:
Range("B" & R).GoalSeek goal:=0.42, ChangingCell:=Range("C" & R)
 
thank you. i should have caught that.

Gary''s Student said:
replace:
Range("B" & R).GoalSeek goal:=0.42, ChangingCell:=Range("C" And R)
with:
Range("B" & R).GoalSeek goal:=0.42, ChangingCell:=Range("C" & R)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top