ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   select method of range class failed (https://www.excelbanter.com/excel-programming/311698-select-method-range-class-failed.html)

Joseph[_38_]

select method of range class failed
 

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

--
Josep

-----------------------------------------------------------------------
Joseph's Profile: http://www.excelforum.com/member.php...nfo&userid=563
View this thread: http://www.excelforum.com/showthread.php?threadid=26419


Kevin

select method of range class failed
 
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
-----Original Message-----

Hi All,

Ok, heres my prob. My code looks at a list of values(user

names) in
cells (231 in all) and checks for the existence of a

filename depending
on each value(username). Then if the file exists it opens

it and is
supposed to select range(B2:G25), then it copies the

selection,
activates the next window and selects the sheet

associated with the
value in the activecell in the original(username) sheet.

Then it is
supposed to paste the values in, close the sheet it

copied from and
carry on to the next one. The problem is the error Im

getting above
when it opens the users sheet! Help would be much

appreciated as I
can't see a real reason for the error. Its in Excel 97 on

WinNT.

Cheers All


--
Joseph


----------------------------------------------------------

--------------
Joseph's Profile: http://www.excelforum.com/member.php?

action=getinfo&userid=5637
View this thread:

http://www.excelforum.com/showthread...hreadid=264190

.



All times are GMT +1. The time now is 10:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com