Also when playing barre chords, think of your index finger as a movable capo, and then it may be easier for you to think where other chords on the guitar are (this is with an understanding that you know where all the notes are on the guitar). For another challenge after you master barre chords in the E format (as desicribed above by SLY), try to learn bare chords in the A format. Play an A:
e-0
b-2
g-2
d-2
a-0
E-0
Easy enough. Now move that up two frets and lay your index finger across the second fret. Should look like this:
e-2(x)
b-4
g-4
d-4
a-2
E-2
You use your 3rd finger (ring finger) to barre the b,g,and d, and you use your first (index) finger to barre the E,a,and e. I put an x in parentheses next to the e-2 because it is hard to get that string to sound, a lot of professional guitarists dont even play this note when they play barre chords in this format. So if you can't get the e string to sound don't be discouraged. Also, just like any other barre chord this can be moved up and down the fretboard to produce otehr chordes.