Private Sub Workbook_Open()
Application.OnKey "{F10}", "MyMacro"
End Sub

vba code for assiging color code to a function key say F1
color code =R 234 G 241 B 221

when the user select 1 or multiple rows , & the user press F1 , the entrie selected row shld be colored with the above colr code

IF F2 then the selected row will have say

color code =R 243 G 245 B 229

assiging function key with color code