Subcarrier and bit allocation has been extensively investigated in the literature to improve the spectral efficiency of multiuser OFDM systems. However, most of the earlier studies using genetic algorithms (GA) focused on single-class service and users of best effort data rate. In this paper, a novel GA method which allocates subcarriers and bits to rate guaranteed users is presented. As the reproduction process generates chromosomes which do not fulfill the constraints, our algorithm integrates the invisible walls technique used in Particle Swam Optimization to retain the diversity of the chromosomes. Simulation results show that the subcarrier and bit allocation strategy computed based on our proposed GA can achieve lower total power consumption compare to an algorithm modified from one of the pervious works. This verifies that our algorithm has better convergence rate and lower risk that the solution will be trapped at local optimums, while guarantees the required bit rate for each class of service.