\documentclass{article}
\newcommand\Ua{AAA}
\newcommand\Ub{BBB}
\newcommand\Uc{CCC}
\newcommand\U{} % Check that \U is not in use
\newenvironment{enva}{\let\U\Ua}{}
\newenvironment{envb}{\let\U\Ub}{}
\newenvironment{envc}{\let\U\Uc}{}
\begin{document}
\begin{enva}
Some text, \U\ some other texts
\end{enva}
\begin{envb}
Some text, \U\ some other texts
\end{envb}
\begin{envc}
Some text, \U\ some other texts
\end{envc}
\end{document}

I like this best, it's what I would've done ;)
– MoriambarApr 9 '17 at 12:45

1

@Moriambar but it gets really tedious when you want to expand it to more environments… (image ten instead of three)
– clemensApr 9 '17 at 12:49

Of course… but I still like it best. I don't know why, it appeals me.
– MoriambarApr 9 '17 at 12:50

2

While it looks good, it's the worst answer so far. Just use envb inside of enva. While the macro should be in mode of envb it only uses the stuff of enva. This is not the desired behavior.
– SkillmonApr 9 '17 at 13:03

@Skillmon Sorry to hear that you don't like my answer. But the question did not mention the possibility of nested environments, and without a bit more background information, it is hard to guess what should happen in this case. If envb is inside enva, \U is still used inside enva - so without more specification regarding the macro output, I don't see where the current behaviour is wrong.
– user36296Apr 9 '17 at 14:19