Here is the rule:
Use AN before words such as "hour" which sound like they start with a vowel even if the first letter is a consonant. Also use AN before letters and numbers which sound like they begin with a vowel, such as "F" or "8". Remember, it is the sound not the spelling which is important. For example, "F" is pronounced "eff" like it starts with an "E".
Examples:
I only have an hour for lunch. Sounds like "au-er".
Does his name begin with an "F"? Sounds like "eff"
Use A before words such as "European" or "university" which sound like they start with a consonant even if the first letter is a vowel. Also use A before letters and numbers which sound like they begin with a consonant, such as "U", "J", "1" or "9". Remember, it is the sound not the spelling which is important. For example, "1" is spelled O-N-E; however, it is pronounced "won" like it starts with a "W".
Examples:
She has a euro. Sounds like "yu-ro".
That number is a "1". Sounds like "won".