Press Alt-F11 to open the Visual Basic editing window.

From the Insert menu select module, a large, mainly blank, window will open up in the right hand pane and the code can be pasted there.

As the previous poster pointed out, if you're using my code you'll need to insert another line reading "End If" between the "End If" that is there and the "End Sub".