I'm not sure if someone already posted this on here but I didn't see it and it's very helpful for mapmakers so I decided to post it anyway.
Be sure to put the name of the block where the quotes are in the command (also take out the quotes)
Credit: Dan95363 (http://www.minecraftforum.net/members/Dan95363)