Forum Discussion
Error when executing an Excel macro to highlight rows and add comments
If you cannot be more specific than listing the error message, we probably need to get you up to speed on debugging VBA. Study some articles like Debugging VBA Code and Excel VBA Debugging Techniques.
Do the debugging, and if the problem is not apparent, you should at least be able to show us the specific statement that causes the error. (But we will probably need some context information as well, such as relevant variable definitions and values at the point of the error; expect more questions.) Let us know which version of Excel you are using, on which platform (Windows or Mac), and in this case, which code libraries you are using (available from the References dialog).
Hopefully you are already including an "Option Explicit" statement at the top of each code module, and you are not trying to cram as much action into each line of code as you can.