Results 1 to 4 of 4
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro or VB (Outlook 2003)

    Create a table of the form

    <table border=1><td align=right>0001</td><td>Name 1</td><td align=right>0002</td><td>Name 2</td><td align=right>0003</td><td>Name 3</td><td align=right>0004</td><td>Name 4</td></table>
    (it can be in a different worksheet if you like). Select this table and type NameList in the Name box on the left hand side of the formula bar, or select Insert | Name | Define..., type NameList and click OK.

    Right-click the sheet tab in which the user will type the numbers, and select View Code.
    Type or paste the following event procedure:

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim oCell As Range
    On Error Resume Next
    If Not Intersect(Target, Range("D")) Is Nothing Then
    Application.EnableEvents = False
    For Each oCell In Intersect(Target, Range("D")).Cells
    oCell.Offset(0, 1) = Application.WorksheetFunction.VLookup _
    (oCell, Worksheets("Sheet1").Range("NameList"), 2, False)
    Next oCell
    Application.EnableEvents = True
    End If
    End Sub

    where Sheet1 is the name of the sheet containing NameList.

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro or VB (Outlook 2003)

    If I understand your question correctly, put the following formula in cell F1 (first cell in column 5):

    <code>
    ="name"&RIGHT(E1,1)
    </code>

    Then copy the formula down the column as far as the numbers go in E (column 4).
    Legare Coleman

  3. #3
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro or VB (Outlook 2003)

    Got it working....

    =IF(Q492=2086,"Steve",IF(Q492=2036,"Juan",IF(Q492= 1603,"Esbon",IF(Q492=4316,"Mark",IF(Q492=1525,"Pat rick","")))))

    Thank you for your help.

  4. #4
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro or VB (Excel 2003)

    Subject edited by HansV - the question has nothing to do with Outlook

    In col4 we have 5 different number...0001, 0002,0003, 0004,0005. In Col5 I want need a Macro or Code, so that if 0002 is present then write name name2.

    0001 name1
    0001 name1
    0003 name3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •