hi..i am new at vba
when i did not select the cell with the "hello" inside, i encounter an error that says object variable or with block variable not set. what does it means?
Please Login or Register to view this content.
hi..i am new at vba
when i did not select the cell with the "hello" inside, i encounter an error that says object variable or with block variable not set. what does it means?
Please Login or Register to view this content.
Last edited by galaxtor; 07-14-2009 at 09:58 PM.
Try this:
EDIT: Roy's note about xlValues didn't stop my search for "hello", but it may on your sheet. Things happen. Changing to xlValues may be the thing to do.Please Login or Register to view this content.
Last edited by JBeaucaire; 07-14-2009 at 03:23 AM.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
You search was looking at Formulas, not a a value, I've also changed selection for UsedRange so that it is not necessary to select the range.
Please Login or Register to view this content.
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
............................
Last edited by D_Rennie; 07-14-2009 at 03:25 AM.
THANK YOU JBeaucaire , royUK, D_Rennie!!!
its working already and i've understand your points =)
hello..yst i posted on this issue object variable not set. i've realise there is an error.
i tried JBeaucaire codes..it was working fine..until i selected on the active cell, it prompt me item was not found.
i also tried royUK codes..it could find the info..but when the info is not found, it did not prompt me the error msg but instead it came out the Object variable or with block variable not set..
anyone can help?
so far this is what i did.
Please Login or Register to view this content.
Last edited by Paul; 07-14-2009 at 09:58 PM. Reason: Moved post to end of previous thread and removed 'SOLVED' prefix
maybe this amended code will help
Please Login or Register to view this content.
You could shorten things a bit with an array or two:
Did you only want the error message if no items are found, or if any of the items are not found?Please Login or Register to view this content.
Remember what the dormouse said
Feed your head
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks