Hi all,
I am working on the following code:
It is failing at the line:![]()
Please Login or Register to view this content.
Can someone please help me fix it.![]()
Please Login or Register to view this content.
Thank you,
Gos-C
Hi all,
I am working on the following code:
It is failing at the line:![]()
Please Login or Register to view this content.
Can someone please help me fix it.![]()
Please Login or Register to view this content.
Thank you,
Gos-C
Last edited by Gos-C; 11-21-2010 at 02:25 PM.
Using Excel 2010 & Windows 10
"It is better to be prepared for an opportunity and not have one than to have an opportunity and not be prepared."
Is there anything below A13? if not, you will receive an error.
Hi davesexcel,
Yes, there is data down to row 50.
Here is the error message:
Run-time error
Application-defined or object-defined error
Last edited by Gos-C; 11-20-2010 at 12:07 PM.
I don't get the error, have you a test file I can enter into the InputBox, I have the first part of the code commented because I can't use it.
Here is a sample of the file. Thank you.
Gos-C
is this the problem?
there is no paste code![]()
Please Login or Register to view this content.
Last edited by lisa_jd; 11-21-2010 at 05:59 AM.
Hi lisa_jd & davesexcel,
I think the problem is with the LastRow because I did a Debug.Print LastRow and I got 1.
Can you please advise.
Thank you,
Gos-C
Here is one way![]()
Please Login or Register to view this content.
Hi davesexcel,
I got the same error. Could it be that the LastRow line is not pointing to the correct sheet?
Here are some interesting results, which may help you figure out the problem:
Debug.Print ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row
=49
Debug.Print ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row - 13
=36
Debug.Print LastRow
=1
This makes me suspect that LastRow in the code is not for the correct sheet, Sname, as it should. If so, how do I fix it.
Thank you,
Gos-C
how about.
How fast this could be answered if you supplied a small example.![]()
Please Login or Register to view this content.
davesexcel,
That's it!
![]()
Please Login or Register to view this content.
Now it's working.
Thank you kindly,
Gos-C
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks