Hi there,
See if the following version of your code does what you need:
The real problem in your code is that in the following statement:
you are attempting to assign a string expression to the variable "filtrodata2" which is declared as a Date variable - the situation is not helped by the fact that the "open-ended" On Error Resume Next statement prevents the "Type Mismatch" error message from giving you an indication as to where the problem is occurring.
Just for information, the statement:
declares xWs as a VARIANT, and xlWs as a worksheet - the same applies to your other Dim statements, i.e. the variables whose types are not explicitly declared are implicitly declared as being of type Variant by default.
Hope this helps - please let me know how you get on.
Regards,
Greg M
Bookmarks