Provided is a compound having an AMPA receptor function enhancing action, and useful as a prophylactic or therapeutic drug for depression, Alzheimer's disease, schizophrenia, attention deficit hyperactivity disorder (ADHD) and the like. A compound represented by the formula (I): wherein each symbol is as defined in the present specification, or a salt thereof.