Is there something immediately wrong with this code?
I just want to figure out how many rows are filled at the top of my active sheet, so I can put something beneath them.Please Login or Register to view this content.
Is there something immediately wrong with this code?
I just want to figure out how many rows are filled at the top of my active sheet, so I can put something beneath them.Please Login or Register to view this content.
Change
toPlease Login or Register to view this content.
Or tryPlease Login or Register to view this content.
in place of the loopPlease Login or Register to view this content.
Col
Last edited by colofnature; 05-29-2007 at 10:39 AM.
If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.
I put in brackets to show what is happening. Your code asks to evaluate whether ActiveSheet.Cells(l,1).Value Is Nothing. Nothing and Is are used only with objects, but Cells.Value is a value ( Double, String, Boolean or Error), not an object. That's where the error came from.Please Login or Register to view this content.
You may want
which is the same asPlease Login or Register to view this content.
Please Login or Register to view this content.
colofnature: Your first solution worked, to use = Empty instead of Is Nothing. However, your second solution (which I like the looks of) gives me an Overflow error. I don't know why, or how to fix it, but that's what it does.
I'm okay with leaving it the way that works. My code is littered with loops, as they're the only way I know how to get the results I want, so one more won't hurt.
EDIT: I figured it out. Using g as an integer, when the Row property returns a long. Thanks for the fix!
Last edited by yellephant; 05-29-2007 at 12:25 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks