Then you just change the range specifier. Something like this:
:20,30s/^/#/
If you're using VIM, you can also select the lines in visual mode by typing V and using the arrows to highlight some lines. Then, when you type : to start the search command, the range will automatically be inserted. Just continue typing s/^/#/ to complete the command.