Nevermind, i figured out what the issue was. i was writing the code in the sheet instead of the Module of the workbook. newbie mistake