If there are 5 occurrences of a value in your range the countif part of the formula will return 5. Adding the "1 over" part to the start changes it to 1/5 (or essentially 0.2). This allows you to sum this up so that you only get a total of 1 (0.2 * 5 in this example) for each unique value in the range.
In the box where you type in "A" just hold down the shift key and then type "A". Don't press Ctrl while you do this or it wont work.
Its probably best practice and a good habit to get into to always define your variables. But its not required, so often when writing a short piece of code I won't bother defining the variable as theres not much to be gained from doing so. For longer code though I would always define them.
There are a few sources for finding that kind of information out. Firstly Excels built in help can be very useful. If you go to the VBA editor and then press F2 it should open a browser window and take you to the help page
Second, the object browser in the editor can be very useful. This is accessed by pressing F2 in the editor and list all the available commands with brief descriptions.
Finally, investing in a good book is an easy way of finding out the useful functions quickly.
This is a beginner tutorial, the intention was to show how you could use macros without needing to know how to code. I have uploaded other videos that go through how to write VBA code.