Making the activecell the target of a copy and paste macros

  • 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.


    Ray


  • Re: Making the activecell the target of a copy and paste macros


    It's a little silly selecting a cell and then checking if the active cell is somewhere else... but maybe you were chopping and changing trying to get it to work.


    Try turning the IF statement around the other way:

  • Re: Making the activecell the target of a copy and paste macros


    It works like a charm cytop! Thanks for your assistance. Your comments make sense even for a VBA hack like myself.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!