+ Reply to Thread
Results 1 to 11 of 11

vFound to search in column A only

  1. #1
    Registered User
    Join Date
    06-21-2009
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    Excel 2003, 2007
    Posts
    26

    Question vFound to search in column A only

    Hi there

    I'm using the following code to search a sheet and copy any matching data to a listbox on a userform:

    Please Login or Register  to view this content.
    However, i'd like it to search column A only. Can this be done? And if so, how? Thanks in advance.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: vFound to search in column A only

    Hi

    change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    rylo

  3. #3
    Registered User
    Join Date
    06-21-2009
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    Excel 2003, 2007
    Posts
    26

    Re: vFound to search in column A only

    Quote Originally Posted by rylo View Post
    Hi

    change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    rylo
    hi,

    thanks for your response; after making the replacement I keep getting the error "argument not optional", though. Any ideas?

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: vFound to search in column A only

    Hi

    Did you change just that part of the code, or did you replace the entire find statement with the snip I provided? What does your full code look like now?

    rylo

  5. #5
    Registered User
    Join Date
    06-21-2009
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    Excel 2003, 2007
    Posts
    26

    Re: vFound to search in column A only

    Hi,

    It now looks like this:
    Please Login or Register  to view this content.
    Last edited by rylo; 07-14-2009 at 06:21 PM. Reason: added code tags

  6. #6
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Re: vFound to search in column A only

    You need to fix your closing code tag, it should be [/code].

    Your MsgBox lines shouldn't have the brackets around the arguments.
    What line is highlighted in the VB editor when you get the error message?
    If you find the response helpful please click the scales in the blue bar above and rate it
    If you don't like the response, don't bother with the scales, they are not for you

  7. #7
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: vFound to search in column A only

    Hi

    How about adding an example file that shows some sample data and all relevant code / forms etc.


    Also the findnext line will need to have the range changed.

    rylo

  8. #8
    Registered User
    Join Date
    06-21-2009
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    Excel 2003, 2007
    Posts
    26

    Re: vFound to search in column A only

    Hi,

    thanks for your help so far; here's the example file.

    Wilco
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: vFound to search in column A only

    Hi

    OK, how about

    Please Login or Register  to view this content.

    rylo

  10. #10
    Registered User
    Join Date
    06-21-2009
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    Excel 2003, 2007
    Posts
    26

    Re: vFound to search in column A only

    Hi,

    That returns the error "named argument not found".

    Wilco

  11. #11
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: vFound to search in column A only

    HI

    I opened your sample file, replaced your code with the code I gave, then adjusted your code for Query_Change as shown below (there doesn't seem to be a sub called filterdeceased in your example file), and it ran through.

    Please Login or Register  to view this content.
    Can you update your example file to show what you have, explain the steps you take to make things work, and nominate exactly where the error occurs.

    rylo

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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