Use of Variables on firewall src-address

I´m traying to do this:
:global lan “192.168.250.0/24”
/ip firewall filter
add action=drop chain=forward comment=“Drop packets from LAN Not in LAN IP Range” in-interface-list=LOCAL_LAN log=yes log-prefix=!LAN_TOWAN_ src-address=!$lan

It seems that variables can´t be used on src-address with negation wildcard !..

If i make the following works fine:
:global lan “192.168.250.0/24”
/ip firewall filter
add action=drop chain=forward comment=“Drop packets from LAN Not in LAN IP Range” in-interface-list=LOCAL_LAN log=yes log-prefix=!LAN_TOWAN_ src-address=$lan

Where i´m making a mistake?

Thanks in advance.

You can make the “!” part of string, either when you define it, or like this:

src-address=("!".$lan)

Thanks very much Sob for your fast and correct response. It works