Hi,
I was only just giving you examples to try not complete scripts you only need to try one of the ways to see if it works. After the Dim statement try one of these methods:
.
Also
.
Should be like this:
The number I was talking about is the count of the worksheets you want to run your code on. For example you open a new workbook you have 3 sheet tabs with the names sheet1 ,sheet2 and sheet3 Say you want to run code on sheet2 you could use sheets("sheet2") by the name of the worksheet or sheets(2) by the index number placement of the worksheet.
You dont really need to activate or select a worksheet to make a script work but it may help you to see what your script is doing when you step through it.
Hope that helps some.
Bookmarks