Results 1 to 8 of 8

How do I Check value of Active cell against column of vaules in another sheet

Threaded View

b1ackcr0w How do I Check value of... 10-10-2012, 09:23 AM
mike7952 Re: Need to Simplify... 10-10-2012, 09:28 AM
b1ackcr0w Re: Need to Simplify... 10-10-2012, 09:39 AM
mike7952 Re: How do I Check value of... 10-10-2012, 10:06 AM
b1ackcr0w Re: How do I Check value of... 10-24-2012, 09:17 AM
b1ackcr0w Re: How do I Check value of... 10-25-2012, 10:04 AM
mike7952 Re: How do I Check value of... 10-25-2012, 12:49 PM
b1ackcr0w Re: How do I Check value of... 10-25-2012, 06:41 PM
  1. #1
    Registered User
    Join Date
    10-10-2012
    Location
    UK
    MS-Off Ver
    excel 2010
    Posts
    5

    How do I Check value of Active cell against column of vaules in another sheet

    A colleague created the following within a Macro...

    If ActiveCell.Offset(0, 4) = "Altran GmbH & Co KG" Or ActiveCell.Offset(0, 4) = "SOCATA S.A.S." Or ActiveCell.Offset(0, 4) = "ALTEN" Or ActiveCell.Offset(0, 4) = "LABINAL GMBH" Or ActiveCell.Offset(0, 4) = "Spirit Aerosystems E" Or ActiveCell.Offset(0, 4) = "ALTRAN INNOVACION S." Then
                '
                If InStr((ActiveCell.Offset(0, 3).Value), "airbus") Or InStr((ActiveCell.Offset(0, 3).Value), "Airbus") Or InStr((ActiveCell.Offset(0, 3).Value), "external") Or InStr((ActiveCell.Offset(0, 4).Value), "AEROTEC") Or InStr((ActiveCell.Offset(0, 3).Value), "AEROLIA") Then
                  '
                  ActiveCell.Offset(0, 7).Select
                  ActiveCell.Value = "E1-EU"
                  ActiveCell.Offset(0, -7).Select
                '
                Else
                  ActiveCell.Offset(0, 7).Select
                  ActiveCell.Value = "EE-EU"
                  ActiveCell.Offset(0, -7).Select
                End If
    This Macro is kept in another file seperate to the data.

    My colleague was expecting not to have to add lots more or conditions to the first line. Now, as you can tell, its grown to the point where we should have a list of company names on a seperate worksheet for maintainability.

    I have pulled all the company names into a worksheet within the file containing the data (.sheet17 fyi). That list is now in the A column of the new worksheet.

    What I can't for the life of me code is how to just check if the activecell.offset(0, 4) is matched anywhere in .sheet17 column A of that other worksheet.

    Ideas anybody?
    Last edited by b1ackcr0w; 10-10-2012 at 09:46 AM. Reason: Vague Thread Title

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