+ Reply to Thread
Results 1 to 9 of 9

Lookup, but "embedded"

Hybrid View

zonino Lookup, but... 10-26-2007, 07:24 PM
WinteE Hi Stan, Why can't you do... 10-27-2007, 04:57 AM
zonino because the files are emailed... 10-27-2007, 07:27 AM
Paul Zonino, You're going to... 10-27-2007, 11:57 AM
zonino I need to put the list of GLs... 10-27-2007, 05:13 PM
Paul Ok, so you DO have a list. ... 10-27-2007, 05:49 PM
zonino option one isn't an option,... 10-27-2007, 07:39 PM
zonino Hi guys, I've been having a... 10-28-2007, 08:20 PM
Paul Hi again, Zonino. To use... 10-28-2007, 09:16 PM
  1. #1
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Ok, so you DO have a list. Step 1, check. As I see it, you have two decent options:

    1. Keep your list of GL Codes and their descriptions in a separate Excel file. Use VLOOKUP or other lookup formulas to pull the description into your primary sheet that you're going to use for SAP. Once the lookups have done their job (and you see all of the descriptions) select that column, copy it and then PasteSpecial->Values on top of itself. Then you won't have any links to another document, just the values.

    2. Since you only have about 15-20 codes, you can use VBA such as a Select Case and a loop through your GL code data. For example, if your GL Codes are in column A, and you want the Descriptions in column B:
    Sub findGL()
        Dim i As Long
        
        For i = 2 To Range("A65536").End(xlUp).Row
            Select Case Cells(i, 1)
                Case "1234-5678", "4567-8901"
                    Cells(i, 2) = "Engineering"
                Case "2345-6789"
                    Cells(i, 2) = "Production"
                Case "3456-7890"
                    Cells(i, 2) = "Sales"
                Case Else
                    Cells(i, 2) = ""
            End Select
        Next i
    End Sub

  2. #2
    Registered User
    Join Date
    08-04-2007
    Location
    London
    MS-Off Ver
    work: 2003, home: 2008 for Mac
    Posts
    32
    option one isn't an option, it has to be completely contained within the one file,

    I'll have a go at option two, ta

  3. #3
    Registered User
    Join Date
    08-04-2007
    Location
    London
    MS-Off Ver
    work: 2003, home: 2008 for Mac
    Posts
    32
    Hi guys, I've been having a think about this, how would I write this as a function, so that I can put =gltext(A1)?

    at some point I'll get round to learning VBA!

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Hi again, Zonino.

    To use as a function, place this code into a standard module:
    Function FINDGL(rng As Range)
        Select Case rng.Text
            Case "1234-5678", "4567-8901"
                FINDGL = "Engineering"
            Case "2345-6789"
                FINDGL = "Production"
            Case "3456-7890"
                FINDGL = "Sales"
            Case Else
                FINDGL = ""
        End Select
    End Function

+ 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