LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default cell.find not working

Hi

For some reason my code is returning the foundcell as true all the time even
though the data is not there. If I do a manual find then it comes back as not
found but with the code it comes back as found which is not correct.

Below is the code I have, if anyone can give me some info on what to do to
fix this probelm.

stVoucherID = Application.Range("A" & dbnum).Value
Sheets(2).Select
Application.Range("F1").Select
Set foundcell = Cells.Find(What:=stVoucherID, After:=ActiveCell,
LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
True)
If foundcell Is Nothing Then
Sheets(3).Select
Application.Range("a1").Select
End if


Thanks
Noemi
 
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
VBA Find and Replace isn't working on apostrophe within cell value Jon[_18_] Excel Programming 2 June 22nd 07 04:10 PM
API to find position of active cell no longer working in 2007. GollyJer Excel Programming 5 June 13th 07 09:29 PM
Loop to find next empty cell to the right not working. Casey[_84_] Excel Programming 3 May 4th 06 03:16 PM
Find Next is not working for me....... Tom Excel Programming 4 December 15th 05 08:27 PM
.find with merged cell not working Sunil Patel Excel Programming 5 July 3rd 05 08:11 PM


All times are GMT +1. The time now is 10:53 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"