Excel 2010 macro - compile error: syntax error

My work upgraded my computer to Excel 2010. A macro that previously run smoothly isn't running anymore.  Now i am getting the error: compile error: syntax error. Code is below:


Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

Dim n As Integer

For n = 6 To 250
If Not WorksheetFunction.IsNumber(ActiveSheet.Range("D" & n)) Then GoTo skiploop
ActiveSheet.Range("Au" & n).GoalSeek _
Goal:=0.001, _
ChangingCell:=ActiveSheet.Range("Ah" & n)

skiploop:
Next
End Sub


Any help is GREATLY appreciated!
 

Question Info


Last updated March 7, 2019 Views 1,074 Applies to:

I don't get a syntax error with that code, there must be something else interfering.


But I would strongly recommend not using it. Performing (potentially) hundreds of GoalSeek operations each time you move to a different cell looks like a bad idea to me.

---
Kind regards, HansV
www.eileenslounge.com

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.