Hello Andreas, thanks for your reply. I made the change as you advised, unfortunately the code does not copy the data in the worksheet anymore.
Erik,
Please paste the code as text here, thanks.
Andreas.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello all,
Microsoft Excel version: Microsoft Professional + 2016
VBA Sub code: Clear_Existing_Data_Before_Paste ( )
I used below code a few times without any problems. This time I got a "Compile error: Invalid use of property" notification.
I`ve not made any changes to the coding, does somebody know how to write the code that it becomes more stable and less error-prone?
Below are two screenshots, first screenshot is of the notification and the second screenshot marked the error.
Screenshot 1:
Screenshot 2:
Any idea is welcome, thanks for your effort.
Kind Regards,
Erik
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Hello Andreas, thanks for your reply. I made the change as you advised, unfortunately the code does not copy the data in the worksheet anymore.
Erik,
Please paste the code as text here, thanks.
Andreas.
In response to "Any idea ..."
I suggest you use Option Explicit at the top of the module.
I have only glanced at your code, but I don't see Dim or definition for wsN.