+ Reply to Thread
Results 1 to 7 of 7

Find function

  1. #1
    Registered User
    Join Date
    02-25-2016
    Location
    Glen Carbon, IL
    MS-Off Ver
    2010
    Posts
    6

    Find function

    Hello. I am new to VBA programming, and I'm stuck on a work assignment.

    Specifically, I have created a user form with a list box. My code is selecting the data I want, and verifying my choice from the list box. From there, I want the macro to find my data in the spreadsheet, but instead my code is only moving my cell pointer one space to the right each time.

    I have the following code set up to choose from my list box

    Please Login or Register  to view this content.
    CHOOSE_EMPLOYEE.Value is the item that the user selected from my list box (only one choice allowed). This code seems to be working correctly.

    Here's the code to find the selected item in my worksheet:

    Please Login or Register  to view this content.
    What I want to happen is to take the value selected from the list box and find it in my worksheet. What is happening, though, is that rather than finding the data Excel is simply moving my cell pointer one cell to the right. Obviously, I'm overlooking something.

    As I said, I'm new to this, so any and all help is greatly appreciated. Thanks so much!!
    Last edited by tvp0905; 03-02-2016 at 05:42 PM. Reason: Code tags added

  2. #2
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    419

    Re: Having trouble with values

    Can you upload the workbook?

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Having trouble with values

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem - not what you think the answer might be. (think google search terms?). Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the address bar)

    Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (note: this change is not optional )
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    02-25-2016
    Location
    Glen Carbon, IL
    MS-Off Ver
    2010
    Posts
    6

    Re: Having trouble with values

    Sure. File attached.

    Thanks again for your help. I appreciate it.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-25-2016
    Location
    Glen Carbon, IL
    MS-Off Ver
    2010
    Posts
    6

    Re: Having trouble with values

    Done. Thanks again for your help.

    **SORRY FOR THE DUPLICATION. I'M NEW TO THE SITE AND DIDN'T NOTICE THE ORIGINAL REPLY HAD POSTED**
    Last edited by tvp0905; 03-03-2016 at 11:35 AM. Reason: Duplication

  6. #6
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    419

    Re: Find function

    I've modified the code below - basically, when you unload the user form, CHOOSE_EMPLOYEE.Value no longer means anything, so you need to assign it to a variable before you close the user form.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-25-2016
    Location
    Glen Carbon, IL
    MS-Off Ver
    2010
    Posts
    6

    Re: Find function

    That did the trick!

    Thanks so much for your help. I very much appreciate it.

+ 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. [SOLVED] trouble with find values
    By 9599lorenzo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-23-2015, 12:12 PM
  2. Trouble Combining Cell Values
    By CCSLBuckles in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-11-2015, 05:51 PM
  3. Replies: 7
    Last Post: 02-06-2014, 04:47 PM
  4. Trouble with If and checking same values
    By CoffeeAddict in forum Excel General
    Replies: 2
    Last Post: 07-20-2012, 11:00 AM
  5. Trouble with COUNTIF non zero values
    By grceiley in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-01-2010, 12:01 PM
  6. Trouble with Determining Double Values
    By ianternet in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-30-2008, 08:17 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