I am making a scheduling system for one of the departments in my business. To make it easier on the user, I have set up a number of common "Start & Finish" times as named ranges (each named range is two cells wide); in the example below one of these named ranges is "sevenam". At the same time I have created a named range (called Paste_Range) for the various cells/columns that a "Start" time can be inserted so the user does not paste Start & Finish times into the wrong columns. (The Paste_Range represents 28 smaller ranges within the same tab)
To execute the copy & paste (as values) function for the user I am setting up a number of macros that correspond with the common "Start & Finish" times; in the example below it is Ctrl+q
The problem is that no matter where is try to execute this code I always get the Msgbox.
Your assistance is appreciated.
' Keyboard Shortcut: Ctrl+q Range("sevenam").Select Selection.Copy If Intersect(ActiveCell, Range("Paste_Range")) Is Nothing Then MsgBox "Please select a correct cell in Columns E, I, M, Q, U, Y or AC.", vbOKOnly, "Warning" Else Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False ActiveCell.Offset(0, 2).Select End If End Sub