select method of range class failed

  • Thread starter Thread starter Joseph
  • Start date Start date
J

Joseph

Hi All,

Ok, heres my prob. My code looks at a list of values(user names) i
cells (231 in all) and checks for the existence of a filename dependin
on each value(username). Then if the file exists it opens it and i
supposed to select range(B2:G25), then it copies the selection
activates the next window and selects the sheet associated with th
value in the activecell in the original(username) sheet. Then it i
supposed to paste the values in, close the sheet it copied from an
carry on to the next one. The problem is the error Im getting abov
when it opens the users sheet! Help would be much appreciated as
can't see a real reason for the error. Its in Excel 97 on WinNT.

Cheers Al
 
Generally the selection should be something like this:

worksheets("sheetname").Range("B2:G25").Select

You may also refer to the sheet by number (from left to
right starting at 1). the same command would look like
this:

worksheets(1).Range("B2:G25").Select

assuming the sheet was sheet 1.

Hope that helps!

If you are still having troubles, post your code and
someone will attempt to find the problem.

Kevin
 
Back
Top