Match function in VBA
You should not enclose a variable name in double quotes
& is for concatenating two strings
e.g.
Name="tom"
MsgBox "Hello! " & Name
The output is
Hello! Tom
When you need to display a quote, you need to use two quotes
e.g.
s="test "" quote"
MsgBox s
The output is
test " quote
esbee wrote:
Many thanks. It's working fine. I didn't know that even '&my_last_row&'
should be enclosed in double quotes. Thanks for this knowledge.
|