473,414 Members | 1,618 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

.Find loop error

25
Hi,

I am working with a loop that has the .Find method in it. I need to figure out how to have the program continue when the find doesn't find anything. The VB Help for Find Method shows the below example but it has the same problem after it enters the loop.

Expand|Select|Wrap|Line Numbers
  1. With Worksheets(1).Range("a1:a500")
  2.     Set c = .Find(2, lookin:=xlValues)
  3.     If Not c Is Nothing Then
  4.         firstAddress = c.Address
  5.         Do
  6.             c.Value = 5
  7.             Set c = .FindNext(c)
  8.         Loop While Not c Is Nothing And c.Address <> firstAddress
  9.     End If
  10. End With
Any ideas?
Jul 31 '08 #1
0 829

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Rollin 4 Eva | last post by:
I've got a Windows 2000 server running with about 50 websites on it, all running ASP scripts. I've noticed that the servers CPU usage gets up 100% sometimes, caused by dllhost.exe, which I'm...
108
by: Bryan Olson | last post by:
The Python slice type has one method 'indices', and reportedly: This method takes a single integer argument /length/ and computes information about the extended slice that the slice object would...
12
by: Mike MacSween | last post by:
On each workstation there's a front end, when the front end opens it checks a 'version number' held in a table of properties against the version number in a copy of the front end held on the...
3
by: Liz Malcolm | last post by:
Hello and TIA for guidance. I am building a reusable search procedure (thanks go to Graham Thorpe for his example that set me on my way). Everything works up until the 2nd match is found, the...
3
by: deko | last post by:
I have a logging routine that's supposed to silently log errors caught by error handler code on certain functions. The problem is sometimes stuff happens and the error handler can get caught in a...
2
by: Brad | last post by:
Thanks for taking the time to read my question. I have code that I am using to tell me info about fields in a table. It is in a loop so I can move through all the fields in the table. ...
27
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res =...
18
by: ma740988 | last post by:
Trying to get more acclimated with the use of function objects. As part of my test, consider: # include <vector> # include <iostream> # include <algorithm> #include <stdexcept> #include...
3
by: shapper | last post by:
Hello, I have 2 data sets: dsLevels and dsLevelsSubscribed. And I created this loop: For Each row As DataRow In dsLevels.Tables(0).Rows ??? row("LevelName") Next row
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.