UsmanBPD
UsmanBPD

Reputation: 5

Why is this VBA code wrong and how can I fix / avoid?

I currently have this code

   Private Sub Worksheet_Change(ByVal Target As Range)
    WorksheetChanged(Target, Range("AB3").CurrentRegion, Range("B18:B19"))
    WorksheetChanged(Target, Range("AE3").CurrentRegion, Range("B20:B21"))
End Sub

But it throws me a "Compile Error: Expected =", I have no idea why and I don't know where an = would go, any help? Thank you in advance.

Upvotes: 0

Views: 68

Answers (1)

Fionnuala
Fionnuala

Reputation: 91376

If you want to use brackets, you need to assign to a variable or in some cases, use Call, if you do not need to assign, skip the brackets:

WorksheetChanged Target, Range("AB3").CurrentRegion, Range("B18:B19")

Upvotes: 3

Related Questions