After checking again the file it works ....
To go forward and to care about TMS' comments here a remake.
in ThisWorkbook
Option Explicit
Private Sub Workbook_Open()
Application.OnKey "~", "ColorCell"
FileName = ActiveWorkbook.Name
End Sub
in a module put
Option Explicit
Public FileName As String
Sub ColorCell()
If (Intersect(ActiveCell, Range("B2:D14")) Is Nothing) Then Exit Sub
If (ActiveSheet.Name <> "Data") Then Exit Sub
If (ActiveWorkbook.Name <> FileName) Then Exit Sub
ActiveCell.Interior.Color = 49407
End Sub
Bookmarks