Copy and Paste Function Not Working ... Need Help Please

bisel

Board Regular
Joined
Jan 4, 2010
Messages
178
Office Version
  1. 365
Platform
  1. Windows
Hello All,

I have strange issue that I do not have an answer for ...

I have a large workbook and if I try to copy a cell and then paste the contents to another cell, this is what I am seeing ...
  • I select the cell and click "copy"
  • The cell indicates that something is pending as it is outlined with dashes
    1623544490771.png
  • I then select another cell (in this case immediately below the one above) and the ability to paste is lost. The original cell where I selected "copy" no longer is outlined in dashes ...
    1623544591714.png
Something strange is that once I copy a cell and then open the clipboard, the cell contents shows in the clipboard and I can then paste from the clipboard. But not using Ctrl+V.

Any thoughts?

Steve
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

rlv01

Well-known Member
Joined
May 16, 2017
Messages
1,159
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Do you have any VBA event code for that sheet? A worksheet change event (Private Sub Worksheet_Change(ByVal Target As Range))? There are are a number of things VBA can do that will interfere with the ability to paste.
 

bisel

Board Regular
Joined
Jan 4, 2010
Messages
178
Office Version
  1. 365
Platform
  1. Windows
Do you have any VBA event code for that sheet? A worksheet change event (Private Sub Worksheet_Change(ByVal Target As Range))? There are are a number of things VBA can do that will interfere with the ability to paste.

I do have VBA event code on that sheet. I have had this code on prior versions of the workbook as well. Here is the code ...

VBA Code:
Private Static Sub Worksheet_SelectionChange(ByVal Target As Range)

Dim cellrow As Integer
Dim cellcol As Integer
Dim KeyCells As Range
Dim duescells As Range
Dim adjustcell As Range
Dim captionname As String
Dim rangename As String
Dim formatname As String

Application.ScreenUpdating = False

'On Error Resume Next

' KeyCells is set for include or exclude cells
    Set KeyCells = Range("adjustcell, incl_incr1, incl_incr2, incl_incr3, special_assess_incl_or_excl")

' Check if an Include or Exclude cell value needs changing
    If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then

        Select Case Target.Value
    
            Case "Include"
                ActiveCell = "Exclude"
                Range("hoaname").Select
                
            Case "Exclude"
                ActiveCell = "Include"
                Range("hoaname").Select
            
            Case "Manual Adjust"
                ActiveCell = "Auto Adjust"
                Range("hoaname").Select
              
              Case "Auto Adjust"
                ActiveCell = "Manual Adjust"
                Range("hoaname").Select
          
            End Select
    Else
    End If

' Check if an Include or Exclude for other annual incomes cells value needs changing
    Set KeyCells = Range("one_time_income_incl_or_excl")

    If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then
    
        Select Case Target.Value
            Case "Include"
                ActiveCell = "Exclude"
                ActiveCell.Offset(0, -6).Select
    
            Case "Exclude"
                If ActiveCell.Offset(0, -6).Value = "" Or ActiveCell.Offset(0, -5).Value = "" Or ActiveCell.Offset(0, -4).Value = "" Or ActiveCell.Offset(0, -3).Value = "" Or ActiveCell.Offset(0, -2).Value = "" Then
                   MsgBox "You cannont include an expense unless Start Year, End Year, Amount, % Annual Increase, and Description data are entered.  One or more of these data are missing.", vbOKOnly + vbCritical, "Missing Data"
                   ActiveCell.Offset(0, -6).Select
                Else
                    ActiveCell = "Include"
                    ActiveCell.Offset(0, -6).Select
                End If
            End Select
    Else
    End If


'Set keycells testing for the contingency fund include/exclude

    Set KeyCells = Range("contin_incl_or_exclude")
        If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then
            Select Case Target.Value
                Case "Include"
                    ActiveCell = "Exclude"
                    ActiveCell.Offset(0, -1).Select
                Case "Exclude"
                    If ActiveCell.Offset(0, -1).Value = "" Or ActiveCell.Offset(1, -1).Value = "" Or ActiveCell.Offset(2, -1).Value = "" Or ActiveCell.Offset(3, -1).Value = "" Or ActiveCell.Offset(4, -1).Value = "" Or ActiveCell.Offset(5, -1).Value = "" Or ActiveCell.Offset(6 - 2).Value = "" Then
                       MsgBox "The Contingency Fund can only be included if all the field values have an entry.  You cannot leave a field blank.  Click the info icon for more information.", vbOKOnly + vbCritical, "Missing Data"
                       ActiveCell.Offset(0, -1).Select
                    Else
                        ActiveCell = "Include"
                        ActiveCell.Offset(0, -1).Select
                    End If
                End Select
        Else
        End If


' Check if autoadjust is turned on
    If Sheet19.Range("autoadjust").Value = True Then
            Range("hoa_dues_start2").Value = Range("incr2_earlystart").Value
            Range("hoa_dues_start3").Value = Range("incr3_earlystart").Value
    Else
    End If

' Lastly, update the control panel fields ...
        Application.Run ("update_controlpanel")
        Sheet19.Activate ' put in to prevent activation of Sheet16 when updating

On Error Resume Next ' resume next if user had only unprotected a single sheet.  Not very likely, but possible

    If Sheet2.Range("maxpctfunding") < 1 Then
        Sheet19.ChartObjects("pctfund_chart").Chart.Axes(xlValue).MaximumScale = 1
        Sheet14.ChartObjects("pctfund_chart").Chart.Axes(xlValue).MaximumScale = 1
        Sheet1.ChartObjects("pctfund_chart").Chart.Axes(xlValue).MaximumScale = 1
    Else
        Sheet19.ChartObjects("pctfund_chart").Chart.Axes(xlValue).MaximumScaleIsAuto = True ' set maxscale back to auto if 1 or more
        Sheet14.ChartObjects("pctfund_chart").Chart.Axes(xlValue).MaximumScaleIsAuto = True ' set maxscale back to auto if 1 or more
        Sheet1.ChartObjects("pctfund_chart").Chart.Axes(xlValue).MaximumScaleIsAuto = True ' set maxscale back to auto if 1 or more
    End If

Application.ScreenUpdating = True
Calculate
End Sub

Do you see anything in the code that may be cause of my problem?

Thanks

Steve
 

bisel

Board Regular
Joined
Jan 4, 2010
Messages
178
Office Version
  1. 365
Platform
  1. Windows
I believe I found the problem ...

The last line before the End Sub statement in the VBA (above) is "Calculate" Removing that line restores the copy and paste function.

Steve
 
Solution

Forum statistics

Threads
1,148,160
Messages
5,745,122
Members
423,927
Latest member
Pra56

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
Top