Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CutCopyMode=False does not work Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 4 September 19th 08 05:32 PM
Application.Visible = False SimonB Excel Discussion (Misc queries) 1 October 15th 06 01:10 PM
Application.DisplayFormulaBar Kills CutCopyMode Ed Adamthwaite Excel Programming 2 July 26th 05 01:59 PM
Using the Application.ScreenUpdating = False? Susan Hayes Excel Programming 0 January 29th 05 03:50 AM
CutCopyMode = False Michael Smith Excel Programming 5 May 7th 04 05:33 PM


All times are GMT +1. The time now is 03:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"