Forum Discussion
Marc_Covents
Oct 23, 2023Copper Contributor
Copy/Paste issue
Hello, I have a copy/paste issue with an Excel file. If I try for example to copy the cell I8 (in Sheet KS_2) from file1.xlsm to another Excel file (file2.xlsm) I get an audible error and the Paste...
HansVogelaar
Oct 23, 2023MVP
Activate file1.xlsm.
Press Alt+F11 to activate the Visual Basic Editor.
Double-click ThisWorkbook in the Project Explorer pane on the left.
Comment out or delete the code
Private Sub Workbook_Activate()
ActiveWindow.DisplayZeros = False
End Sub
Private Sub Workbook_Deactivate()
ActiveWindow.DisplayZeros = True
End Sub
Switch back to Excel.
Save the workbook.
- Marc_CoventsOct 23, 2023Copper Contributor
Your solution works. Thank you.
I added this code because I don't want to see 0 values when the result of a formula is 0
Do you also have an explanation why this is happening? At first sight this doesn't have anything to do with the copying of data.Marc.
- HansVogelaarOct 23, 2023MVP
Many VBA actions clear Excel's clipboard.
Changing the value of ActiveWindow.DisplayZeros is one of them, as you have found...
- Marc_CoventsOct 23, 2023Copper ContributorThanks!