In 1852, delegate William C. Carrington, who represented Richmond in the Virginia General Assembly. Anderson won the special election to succeed him, and would be re-elected several times. He served initially alongside William F. Butler and Conway Robinson, and after A. Judson Crane resigned, alongside George N. Johnson. He was re-elected in 1853, but his fellow delegates became James A. Cowarding and Henry K. Ellyson. He failed to win election to the assembly of 1855-56, but did win election to the House of Delegates again in 1857, this time serving with Roscoe B. Heath and Richard O. Haskins.