+ Reply to Thread
Results 1 to 4 of 4

Find in VBA finds first instance of similar object being searched but not exact object

  1. #1
    Registered User
    Join Date
    08-24-2012
    Location
    Columbus
    MS-Off Ver
    Excel 2010
    Posts
    46

    Find in VBA finds first instance of similar object being searched but not exact object

    Below is the section of code I need help with. VBA is summing the correct range however it's entering that data point at an incorrect location. It's running the code for the first instance it finds "Electronics" which is further up the spreadsheet under "Consumer Electronics". Is there a way I can search for only what's in quotes rather than anything that's contained in the quotes? This would be the ideal solution. Another alternative that would be as effective for this case but not neccessarily all cases would be to establish my search range such that it won't include "Consumer Electronics". Example .Range("C100:C10000").Find instead of .Columns("C:C").Find

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Find in VBA finds first instance of similar object being searched but not exact object

    You should be made aware of the entirety of the Range.Find method. See link

    http://msdn.microsoft.com/en-us/libr...ffice.15).aspx

    With that being said, it sounds like you are having an issue with xlWhole vs xlPart
    Please Login or Register  to view this content.
    You can also work with some of the other parameters to acheive your desired results.

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Find in VBA finds first instance of similar object being searched but not exact object

    Maybe?

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-24-2012
    Location
    Columbus
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Find in VBA finds first instance of similar object being searched but not exact object

    Thanks a lot stnkynts and JOHN H. DAVIS! This works flawlessly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 06-19-2014, 02:09 PM
  2. Active X Component Can't Create Object: Multiple Excel Instance Error
    By schwimms in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-29-2013, 12:51 PM
  3. How to write a fonction which finds if an object is in a list or not
    By Valou Choc in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-05-2012, 08:42 AM
  4. [SOLVED] Using Object model to start an instance of excel on another computer?
    By P in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-14-2006, 04:40 PM
  5. [SOLVED] Is there an object similar to Matlab vectors/matricies/cells?
    By A C in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-31-2005, 06:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1