Aside from the fact that your SQL statement is invalid, QUOTENAME() simply places brackets "[]" around the supplied variable. Replace the EXECUTE statement with a PRINT statement, and you'll get the following results:
DECLARE @tablename AS NVARCHAR(100)
SET @tablename = N'Table2A'
DECLARE @execquery AS NVARCHAR(MAX)
SET @execquery = N'
SELECT *
WHERE tableName = ''' + QUOTENAME(@tablename) + N''''
PRINT @execquery
--EXECUTE sp_executesql @execquery
RESULTS:
SELECT *
WHERE tableName = '[Table2A]'