NY 240 was first designated in the renumbering of state highways in New York in 1930 from NY 39 in Springville to NY 18 near downtown Buffalo. The portion between Springville and Ashford was a section of NY 62 and Harlem Road was unnumbered. The section south of CR 16 in West Valley was a portion of NY 242. NY 240 instead used Abbott Road and South Park Avenue to get to Buffalo, which got extended to NY 5 in the 1930s. NY 240 was realigned south to Ellicottville in the mid-1960s, after numerous bypasses and realignments had been done by the State of New York Department of Public Works. NY 240 was realigned onto Harlem Road c. 1962. The former alignment to Buffalo is now designated as NY 950M, a reference route.