Application.CutCopyMode = xlCopy Does Not Retain Value

lnagel

Board Regular
Joined
May 28, 2018
Messages
117
I have an odd issue where the underlying VBA in my "WorkSheet" Code does not retain the value of a "Copy" after pasting to a cell.

Subsequently - I am unable to utilize the qat "UNDO" shared control as the copy value always reverts to Application.CutCopyMode = False immediately after pasting - thus rendering Qat "Undo" virtually useless (also removes the ability to past to additonal cells after the initial paste)

My attempt to remedy so far consists of adding "Application.CutCopyMode = xlCopy" to my preprocessing in the "WorkSheet"

This does result in the selected copy cell showing the "marching ant border" on the copied cell (which it did not do prior to Application.CutCopyMode = xlCopy command) but still does not result in allowing multiple paste functionality or QAT "Undo" functionality

Hoping that someone has run into this issue before and can point me in the right direction as I seem to be totally clueless ATM - Thanks in advance

The vba worksheet code in question is as follows:

Code:
Application.CutCopyMode = xlCopy
'------------------------------------------------------------
'Column "E" Processing
'------------------------------------------------------------
   Application.EnableEvents = True
   Set Changed = Intersect(Target, Range("A:A, C:D, G:H"))
   If Not Changed Is Nothing Then
      Application.EnableEvents = False
      For Each c In Changed
        If LCase(Range("E" & c.Row)) = "need" Then
        c.ClearContents
         With Range("A" & c.Row)
            .Value = Range(.Validation.Formula1)(1).Value
         End With
        End If
      Next c
   Application.EnableEvents = True
   Application.CutCopyMode = xlCopy
   End If
'---------------------------------------------------------------
  Application.EnableEvents = True
  Set Changed = Intersect(Target, Columns("E"))
  If Not Changed Is Nothing Then
      Application.EnableEvents = False
      For Each c In Changed
        c.Value = UCase(c.Value)
        If LCase(c.Value) = "need" Then
          Intersect(c.EntireRow, Range("A:A, C:D, G:H")).ClearContents
          With Range("A" & c.Row)
            .Value = Range(.Validation.Formula1)(1).Value
          End With
        End If
      Next c
      Application.EnableEvents = True
      Application.CutCopyMode = xlCopy
  End If
'------------------------------------------------------------
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
As you code is not copying anything, I don't understand what you mean by
the underlying VBA in my "WorkSheet" Code does not retain the value of a "Copy" after pasting to a cell.
Also when a macro makes any changes it "wipes" the "Undo" stack.
 
Upvote 0
The macro shown applies to the cell (Column E, Row is variable) that I am copying (manually) - I feel like the problem lies in that code and I believe you have probably shed some light

Whan a macro makes any changes it wipes the undo stack - Is there any way to prevent that wipe of the undo stack with VBA Code?
 
Upvote 0
Looks like it is "possible" BUT not easily accomplished - Will involve writing code to reverse the macro functionality that wiped the stack. Might play with that a bit. At least I now understand the problem - Thanks so much for your help!
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,187
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top