Google Sheets – Join multiple scopes when using conditional formatting

I have a simple formula for conditional formatting that highlights duplicate values ​​in a column:

= countif (A: A, A1)> 1

I have another column on another worksheet (the same workbook) that I want to consider when looking for duplicates. I can combine the areas with the following formula separately:

= Query ({Sheet1! A: A; Sheet2! A: A}, "where Col1 <> & & # 39;")

but I can not use this formula in conditional formatting. What I have (which does not work) is:

= countif (query ({Sheet1! A: A; Sheet2! A: A}, "where Col1 <> &" "), A1)> 1

I do not understand how "where Col1 <> is & # 39;" works or why I need it, but still the formula does not work.

The question is, how can I (using conditional formatting) highlight duplicate cells in column A and search for duplicates in multiple areas?