+ Reply to Thread
Results 1 to 9 of 9

Need tScript Needs to Skip Names If They are Not Present in Both Worksheets

  1. #1
    Registered User
    Join Date
    03-06-2010
    Location
    Plano, Texas
    MS-Off Ver
    Excel 2007
    Posts
    7

    Need tScript Needs to Skip Names If They are Not Present in Both Worksheets

    So, as a preface, I am a complete novice at excel. I recently attended a small vba seminar for excel and realized that vba could eliminate a lot of headache with my research. The problem is that I have little to no knowledge of programing, so I've been working at this for awhile now. Any help would be appreciated.

    I'm attempting to write a program that will analyze names (that also have numbers in them) in one worksheet. We can call this Worksheet A -- the names are all in column A. I would like the program to then be able to search a second worksheet, worksheet B, and find the matching name. The name will also be in column A on worksheet B. I would then like the program to look at the data that is adjacent to the name in the row direction -- horizontally to the right and determine if the value is greater or smaller than .9 (greater than 0.9 in the positive direction or greater than -0.9 in the negative direction). If both the adjacent values next to the name in worksheets A and B meet the criteria, i.e. only if they are both greater than .9 or smaller than -.9 then I would like the program to output the name to a third worksheet -- worksheet c. It would also be lovely if it could output the associated numbers into the third worksheet, but I believe that will be way too difficult for me to do.

    I have started to write something that Would find a name and then put it onto a third sheet. But, again, its a very elementary attempt, and I'm begining to believe that this is well beyond my capabilities.

    Any pointers in the write direction or help would be greatly appreciated.

    Please Login or Register  to view this content.
    that is what i have done

    The file associated with that is attached.
    Attached Files Attached Files
    Last edited by Fyre182; 03-18-2010 at 09:51 AM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Help a Researcher Crunch Numbers

    Does this do what you want?
    Please Login or Register  to view this content.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Help a Researcher Crunch Numbers

    Welcome to the forum, Fyre.

    Please take a few minutes to read the forum rules, and then change your QUOTE tags to CODE tags.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    03-06-2010
    Location
    Plano, Texas
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Help a Researcher Crunch Numbers

    Welcome to the forum, Fyre.

    Please take a few minutes to read the forum rules, and then change your QUOTE tags to CODE tags.

    Thanks.
    Sorry about that. I'll be sure not to forget.

    Does this do what you want?
    Thank you so much. I didn't expect to get this much help. But, no, that doesn't quite do what I need but its definitely a start in the right direction. Thank you very very much.

    I just tried the script and it seems to be pulling any name that has a value greater than .9 or less than -.9 associated with it. Instead, I only want names with values that satisfy being greater than .9 or less than -.9 in both worksheets a and b. So in this example at423h.1 should not make the list on C, since on worksheet b it is only -.2 and not -.9 or less as in -1, -1.1 etc.

    at423h.1 is valued at -1.2 on worksheet A which should allow it to be on the final worksheet with the associated value, but since on worksheet b its value is only -.2, in the end, it should not make it

    It also seems that on the final sheet-- worksheet c, the values in column c are just repeats of column b, instead of the values associated with the name on sheet b.

    I'm sure this is very confusing. Thank you again for your response.
    Last edited by Fyre182; 03-06-2010 at 09:22 PM.

  5. #5
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    Re: Help a Researcher Crunch Numbers

    Hi
    Run the macro "compare" in the attached workbook and see if the output in sheet C matches your expectation
    ravi
    Attached Files Attached Files

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Help a Researcher Crunch Numbers

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Help a Researcher Crunch Numbers

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

  8. #8
    Registered User
    Join Date
    03-06-2010
    Location
    Plano, Texas
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Need tScript Needs to Skip Names If They are Not Present in Both Worksheets

    I am extremely sorry. I have made corrections, I hope that the post now complies with the rules.

    Is there a way that using the code that ravishankar provided can have the script simply make note if a name is present on one list and not on another.

    For example, if the name jimbob was present on the first worksheet and not present on the second worksheet. Instead of the program spitting out an error and stopping. Is there a way to make the program simply make a note in sheet c and then go on?

    Please Login or Register  to view this content.
    re-uploaded sheet with some names and values that appear on one sheet but not on the other.

    thank you again to anyone who helps. Even a pointer in the right direction is helpful

    thank you
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Need tScript Needs to Skip Names If They are Not Present in Both Worksheets

    I made a very simple mistake before. I think below should work.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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