EX-23 5 dex23.txt CONSENT OF ERNST & YOUNG LLP Exhibit 23 CONSENT OF ERNST & YOUNG LLP, INDEPENDENT AUDITORS We consent to the incorporation by reference in the Registration Statements on Form S-8 (Nos. 333-76847 and 333-83998) pertaining to the Trex Company, Inc. 1999 Employee Stock Purchase Plan and the Trex Company, Inc. 1999 Stock Option and Incentive Plan of our report dated February 8, 2002, with respect to the consolidated financial statements of Trex Company, Inc. included in its Annual Report (Form 10-K) for the year ended December 31, 2001, filed with the Securities and Exchange Commission. /s/ Ernst & Young LLP March 19, 2002 McLean, Virginia