You seem to be creating a sledgehammer to crack a nut here.Try the following line:activesheet.cells.specialcells(xllastcell).row