Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
bl bl is offline
external usenet poster
 
Posts: 7
Default Run-time error '91'

Hi there!

Please help me on the following matter. I want to use FIND in order to
identify if the text from one cell exists in another spreadsheet. The fact is
that I want to test not just one cell, but let's say 300 cells. The code I
made runs until one value is not found in the lookup spreadsheet. The message
I receive is "object variable or With block variable not set". It is Run-time
error '91'.

So, if you have any idea how to avoid this message, please let me know...

Thanking in advance

BL
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Run-time error '91'

if you do

cells.find("value").Select

and value is not found, you will get that error. A better approach is

set rng = cells.find("Value")
if not rng is nothing then
rng.select
else
msgbox "Value not found"
End if

--
Regards,
Tom Ogilvy

"bl" wrote in message
...
Hi there!

Please help me on the following matter. I want to use FIND in order to
identify if the text from one cell exists in another spreadsheet. The fact

is
that I want to test not just one cell, but let's say 300 cells. The code I
made runs until one value is not found in the lookup spreadsheet. The

message
I receive is "object variable or With block variable not set". It is

Run-time
error '91'.

So, if you have any idea how to avoid this message, please let me know...

Thanking in advance

BL



  #3   Report Post  
Posted to microsoft.public.excel.programming
bl bl is offline
external usenet poster
 
Posts: 7
Default Run-time error '91'

thanks a lot for answering. I think I got the idea and I'll fix the problem

Rgds

"Tom Ogilvy" wrote:

if you do

cells.find("value").Select

and value is not found, you will get that error. A better approach is

set rng = cells.find("Value")
if not rng is nothing then
rng.select
else
msgbox "Value not found"
End if

--
Regards,
Tom Ogilvy

"bl" wrote in message
...
Hi there!

Please help me on the following matter. I want to use FIND in order to
identify if the text from one cell exists in another spreadsheet. The fact

is
that I want to test not just one cell, but let's say 300 cells. The code I
made runs until one value is not found in the lookup spreadsheet. The

message
I receive is "object variable or With block variable not set". It is

Run-time
error '91'.

So, if you have any idea how to avoid this message, please let me know...

Thanking in advance

BL




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) Tim[_36_] Excel Programming 4 April 23rd 04 02:53 AM
Run-time error '11' & Run-time error '1004' Piers Clinton-Tarestad Excel Programming 0 January 9th 04 08:35 PM
Run-time error '11' & Run-time error '1004' Piers Clinton-Tarestad Excel Programming 0 January 9th 04 07:45 PM


All times are GMT +1. The time now is 01:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"