I have the following code.............it has a run time error when i try to determine the array is empty.........any ideas why this is ahappening?
I have the following code.............it has a run time error when i try to determine the array is empty.........any ideas why this is ahappening?
I don't know much about arrays, but isn't "isarrayempty" a boolean?
Hi,
I've had this problem too. Check out the IsArrayEmpty function here:
http://www.cpearson.com/excel/vbaarrays.htm
Cheers,
Dom
Hi welchs101
Replace this codewith this code![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
John
If you have issues with Code I've provided, I appreciate your feedback.
In the event Code provided resolves your issue, please mark your Thread as SOLVED.
If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.
thanks.
question: if i have the following code.......in this code the array is empty because i have not done anything with it yet.........i run your code on it and i get a type mismatch error. Am i using it wrong. i know i have not assigned anything to the array yet but can i only use the array after i assign and then take away things from it.
![]()
Please Login or Register to view this content.
You declared it as a variant, not an array.
Everyone who confuses correlation and causation ends up dead.
romperstomper............thanks.
Question:
For lngrow < 6 the sht_array never gets anything assigned to it. Since i assigned it as variant rather than array.........what would you recommend i do to test to see if any assignment had been made.
![]()
Please Login or Register to view this content.
actually, i was just thinking ........if lngrow>6 then i can handle this case via the already present IF statements.
Thanks for all the inputs.
You can test using IsArray.![]()
![]()
Please Login or Register to view this content.
Is there a question there somewhere for someone?
romperstomper,
thanks! that worked. i checked both cases and it worked. thanks.
snb,
i ran the code you sent...........i think its trying to tell me something useful but i am not sure what. cant seem to match up what is telling me with what is on sheet1.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks