The following command executes :command on lines 23 to 56:
:command
23
56
:23,56command
NB: Ranges are inclusive by default.