Dividing a part into equal spaces

How can you do this without knowing how many you need? Maybe this is better. When you are modeling a wall and you want the studs on 18" centers, can you do that without knowing how many I need?