Okay, I was wrong. It seems you can use:
But errors would occasionally pop up if I looked at a worksheet while the code was executing, because this would at times change which sheet is active. Otherwise, the line which you said didn't work, actually worked for me more than once.
I bet your macros would work better if you didn't use the Active Sheet and Select. It would also be easier to watch what is going on.
For example, to find the last row in column A of wb1 you should try:
Note: A Range statement or Cells statement without a dot before it refers to the Active Sheet,
but a range or cells with a dot before it (and nothing else) refers to the With statement.
Thus in the above code, both (!!) .Cells & .Rows refers to wb1.Worksheets(1).
Also:
Could be just:
And why this?
I couldn't get the above to work (of course, I added the file names), so I had to change it to the more traditional.
Bookmarks