Used with verbs of giving, telling, showing, etc., to mean the action is directed toward any person. Often appears in negative sentences to mean 'to no one'.
Please don't tell this secret to anyone.
by anyone; by everyone
Used in passive or potential constructions to indicate the agent is any person. Often in negative form to mean 'by no one'.
This problem couldn't be solved by anyone.
in anyone; in everyone
Used with verbs or adjectives describing existence, perception, or qualities that reside in people. Often in negative sentences to mean 'in no one'.
Everyone has flaws (lit. In everyone there are flaws).
He treats everyone kindly.
His talent is recognized by everyone.
そんな考えは誰にも浮かばないだろう。
Such an idea wouldn't occur to anyone (lit. wouldn't come to anyone's mind).