ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Unspecify Error in Range count (https://www.excelbanter.com/excel-programming/285741-unspecify-error-range-count.html)

BinhNT

Unspecify Error in Range count
 
I have the error with this statement:

MyRow = Workbooks("convert").Sheets("CNV").Cells(65536,
1).End(xlUp).Row()

The error "Subscript out of range". event it has been OK for running
thousand times before. I have remove Exel XP and reinstall it but it
still have error. Now, I use Office2003 but everything can not work.
May be it came from some update of my WindowsXP, but I have reinstall
my WindowsXP already.

Could you help me to solve this? Thanks much!


---
Message posted from http://www.ExcelForum.com/


patrick molloy

Unspecify Error in Range count
 
Sounds like the sheet name may be wrong.
Try to isolate the error..
break it out & see where the error comes

WITH Workbooks("convert").Sheets("CNV").
MyRow = .Range("A65000").End(xlUp).Row
END WITH

Note that there are no brackets round Row
.Row
not
.Row()


Patrick Molloy
Microsoft Excel MVP




-----Original Message-----
I have the error with this statement:

MyRow = Workbooks("convert").Sheets("CNV").Cells(65536,
1).End(xlUp).Row()

The error "Subscript out of range". event it has been OK

for running
thousand times before. I have remove Exel XP and

reinstall it but it
still have error. Now, I use Office2003 but everything

can not work.
May be it came from some update of my WindowsXP, but I

have reinstall
my WindowsXP already.

Could you help me to solve this? Thanks much!


---
Message posted from http://www.ExcelForum.com/

.


BinhNT[_2_]

Unspecify Error in Range count
 
Patrick Molloy wrote:
[b]Sounds like the sheet name may be wrong.
Try to isolate the error..
break it out & see where the error comes

WITH Workbooks("convert").Sheets("CNV").
MyRow = .Range("A65000").End(xlUp).Row
END WITH

Note that there are no brackets round Row
.Row
not
.Row()


Patrick Molloy
Microsoft Excel MVP


Thanks Patrick,
I have tried to change, this time the error appears follow:
WITH Workbooks("convert").Sheets("CNV")

with the same description "Subscript out of range".
I also change it to
MyRow = Worksheets("CNV").Cells(65536,1).End(xlUp).Row()

and it works well. But this way is useful when I work in currently
workbook only and ofcourse I could not reference to worksheets in
another workbook. Sounds it needs some lib, but I do not know yet.


---
Message posted from http://www.ExcelForum.com/


Dave Peterson[_3_]

Unspecify Error in Range count
 
Does it work if you include the .xls?

WITH Workbooks("convert.xls").Sheets("CNV")......




BinhNT wrote:

Patrick Molloy wrote:
[b]Sounds like the sheet name may be wrong.
Try to isolate the error..
break it out & see where the error comes

WITH Workbooks("convert").Sheets("CNV").
MyRow = .Range("A65000").End(xlUp).Row
END WITH

Note that there are no brackets round Row
.Row
not
.Row()


Patrick Molloy
Microsoft Excel MVP


Thanks Patrick,
I have tried to change, this time the error appears follow:
WITH Workbooks("convert").Sheets("CNV")

with the same description "Subscript out of range".
I also change it to
MyRow = Worksheets("CNV").Cells(65536,1).End(xlUp).Row()

and it works well. But this way is useful when I work in currently
workbook only and ofcourse I could not reference to worksheets in
another workbook. Sounds it needs some lib, but I do not know yet.

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson


BinhNT[_3_]

Unspecify Error in Range count
 
Many thanks Dave,
It works well, everything.


---
Message posted from http://www.ExcelForum.com/



All times are GMT +1. The time now is 01:55 PM.

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