Code:
  Dim namelengCHR as STRING
  nameleng = Number(username.length) + 8 * Rnd(3) + 65
  namelengCHR = Chr(nameleng)
Or, even add your IF statement logic in between the lines

EDIT: Just noticed that you didn't declare nameleng as anything, which creates an OBJECT