Welcome to the Forum Nicole17!
The code Resume Next causes execution to resume at the line of code following the one that caused the error. In your case, that line is the assignment of Sal to the Kb cell. So when you resume after the error, that line of code wipes out the value that was put there by your error handler.
To fix it, have your error handler update Sal instead of putting the value in the cell.
I have made the minimal changes necessary to get your code to work. Here is another suggestion. Putting a Resume Next in an error handler results in what we old timers call "spaghetti code." Looking at the code you can't be sure where execution is going after that Resume Next (an experienced VBA programmer will know exactly which lines of code can raise a 1004 error, but it's better to be obvious). Here is another way to do this. This way you know exactly where the code is flowing under what conditions.
Bookmarks