Hi there,
Firstly, you have an unpaired End If statement in your code, but I'll assume that the corresponding If statement just "fell by the wayside" when you were copying your actual code to the post.
Secondly (and more importantly), this statement will fail if Sheet(2) is not the active sheet when the code is running, but this failure will be hidden by the On Error Resume Next statement in the preceding line. This can be overcome by inserting the highlighted line.
In general you should always include an On Error GoTo 0 (or equivalent) statement as close as possible to the On Error Resume Next statement - this will ensure that errors occurring later in the code are not unintentionally hidden.
Hope this helps - please let me know how you get on.
Regards,
Greg M
Bookmarks