Yes.
It’s actually pretty easy, and many people know how.
But, we don’t know much about you, your abilities or much else, for that matterr, since you’re not a regular here. You haven’t given much information in the way of which version of Photoshop you’re working with (if it isindeedthe full version of Photoshop…you might be surprised at the number of people who get lost, and post questions about other applications in this forum), nor do we know what your skill-level is…there are several ways to answer your request. You haven’t spoken about what the final use for your unfilled-rectangle will be….this could determine which method you’d use.
Do you see what I’m getting at?
By the time I finished typing "Yes", above, I fully answered your question.
I even added a sencond sentence that explained the difficulty level, and spoke to the number of people who know the answer.
Please ask again, and fill in some of the blanks. If you provide good questions, you get good answers.