It works if I am in the specific sheet, but if I set the sheet as follows:
Set res = Sheets("2"
ActiveSheet.Cells.Clear
it will not work.
Any idea why?
Use res.Clear or if you want to retain formatting use res.ClearContents.
Sheets("2" refers to a sheet named 2 (not the second sheets in the sheets collection. If youe working with the second sheet use Sheets(2), or better still use the actual name of the sheet, just in case the sheets get re-ordered.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.