Exhibit 23
Consent of Independent Registered Public Accounting Firm
We consent to the incorporation by reference in the following Registration Statements:
| Registration Statements (Form S-8, No. 333-76847, 333-83998, 333-124685, and 333-150690) pertaining to the amended and restated 1999 Stock Option and Incentive Plan (now 2014 Stock Incentive Plan) of Trex Company, Inc., and |
| Registration Statement (Form S-3, No. 333-161732) of Trex Company, Inc.; |
of our reports dated February 27, 2023, with respect to the consolidated financial statements of Trex Company, Inc. and the effectiveness of internal control over financial reporting of Trex Company, Inc. included in this Annual Report (Form 10-K) of Trex Company, Inc. for the year ended December 31, 2022.
/s/ Ernst & Young LLP
Tysons, Virginia
February 27, 2023