+ Reply to Thread
Results 1 to 3 of 3

Why is Application.CutCopyMode False?

  1. #1
    Gary''s Student
    Guest

    Why is Application.CutCopyMode False?

    In the following example:

    Sub macromaster()
    Call Macro1
    MsgBox (Application.CutCopyMode)
    Call Macro2
    End Sub

    Sub Macro1()
    Range("A1").Select
    Selection.Copy
    MsgBox (Application.CutCopyMode)
    End Sub

    Sub Macro2()
    MsgBox (Application.CutCopyMode)
    Range("B2").Select
    Selection.PasteSpecial Paste:=xlPasteValues
    End Sub

    If I execute macromaster, it calls Macro1 which does the copy, messaging
    that Application.CutCopyMode is TRUE (1). Macro2 is then called which
    re-confirms that Application.CutCopyMode is still TRUE and the paste/special
    works.

    If, however, I in the worksheet Select A1 and type CNTRL-C or pull-down Edit
    > Copy and then call Macro2 directly, Macro2 reports that

    Application.CutCopyMode is FALSE, and naturally the paste fails.


    Why?
    --
    Gary's Student (gsnu)

  2. #2
    Tom Ogilvy
    Guest

    Re: Why is Application.CutCopyMode False?

    When you run macro2 or any macro by going through the menus, it clears the
    clipboard if it contains a copied range as I recall.

    --
    Regards,
    Tom Ogilvy

    "Gary''s Student" <GarysStudent@discussions.microsoft.com> wrote in message
    news:4529073A-E979-481D-BE82-1D0F4F3F7FCE@microsoft.com...
    > In the following example:
    >
    > Sub macromaster()
    > Call Macro1
    > MsgBox (Application.CutCopyMode)
    > Call Macro2
    > End Sub
    >
    > Sub Macro1()
    > Range("A1").Select
    > Selection.Copy
    > MsgBox (Application.CutCopyMode)
    > End Sub
    >
    > Sub Macro2()
    > MsgBox (Application.CutCopyMode)
    > Range("B2").Select
    > Selection.PasteSpecial Paste:=xlPasteValues
    > End Sub
    >
    > If I execute macromaster, it calls Macro1 which does the copy, messaging
    > that Application.CutCopyMode is TRUE (1). Macro2 is then called which
    > re-confirms that Application.CutCopyMode is still TRUE and the

    paste/special
    > works.
    >
    > If, however, I in the worksheet Select A1 and type CNTRL-C or pull-down

    Edit
    > > Copy and then call Macro2 directly, Macro2 reports that

    > Application.CutCopyMode is FALSE, and naturally the paste fails.
    >
    >
    > Why?
    > --
    > Gary's Student (gsnu)




  3. #3
    Gary''s Student
    Guest

    Re: Why is Application.CutCopyMode False?

    Thank you Tom:

    Assigning a short-cut key fixed the problem
    --
    Gary's Student


    "Tom Ogilvy" wrote:

    > When you run macro2 or any macro by going through the menus, it clears the
    > clipboard if it contains a copied range as I recall.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Gary''s Student" <GarysStudent@discussions.microsoft.com> wrote in message
    > news:4529073A-E979-481D-BE82-1D0F4F3F7FCE@microsoft.com...
    > > In the following example:
    > >
    > > Sub macromaster()
    > > Call Macro1
    > > MsgBox (Application.CutCopyMode)
    > > Call Macro2
    > > End Sub
    > >
    > > Sub Macro1()
    > > Range("A1").Select
    > > Selection.Copy
    > > MsgBox (Application.CutCopyMode)
    > > End Sub
    > >
    > > Sub Macro2()
    > > MsgBox (Application.CutCopyMode)
    > > Range("B2").Select
    > > Selection.PasteSpecial Paste:=xlPasteValues
    > > End Sub
    > >
    > > If I execute macromaster, it calls Macro1 which does the copy, messaging
    > > that Application.CutCopyMode is TRUE (1). Macro2 is then called which
    > > re-confirms that Application.CutCopyMode is still TRUE and the

    > paste/special
    > > works.
    > >
    > > If, however, I in the worksheet Select A1 and type CNTRL-C or pull-down

    > Edit
    > > > Copy and then call Macro2 directly, Macro2 reports that

    > > Application.CutCopyMode is FALSE, and naturally the paste fails.
    > >
    > >
    > > Why?
    > > --
    > > Gary's Student (gsnu)

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1