+ Reply to Thread
Results 1 to 2 of 2

Concatenate and vlookup function in vba

  1. #1
    Felicity Geronimo
    Guest

    Concatenate and vlookup function in vba

    Hi,

    I have the following problem:

    I need use the following formula in a vba function: (but keep
    failing)and then place the result in a text/prn file.

    =CONCATENATE('Inputs'!E2,'Inputs'B2,VLOOKUP('Inputs'!E2,EmpInfo!A:D,3,FALSE),"780",'Inputs'!F2,'Inputs'!G2))

    Eg.1

    E2 = 012 (text field, usually has leading zero)
    E2 = 05050 ((text field, usually has leading zero)
    Vlookup answer = " " (5 spaces)
    F2 = 01012005 (date)
    G2 = 2377000 (salary of 23770.00 - formatted)

    The result would be:

    01205050 010120052377000

    Eg.2

    E2 = 010 (text field, usually has leading zero)
    E2 = 12345(text field, usually has leading zero)
    Vlookup answer = " " (6 spaces)
    F2 = 05112005 (date)
    G2 = 5555000 (salary of 555550.00 - formatted)

    The result would be:

    01012345 0511200555555000

    I then need to do this for all the rows of data in the input sheet,
    and then export the data as a text/prn file.

    Your help would be much appreciated.

    Kind Regards

    Flick

  2. #2
    K Dales
    Guest

    RE: Concatenate and vlookup function in vba

    As far as I can see your formula should work except for a minor typo:
    =CONCATENATE('Inputs'!E2,'Inputs'!B2,VLOOKUP('Inputs'!E2,EmpInfo!A:D,3,FALSE),"780",'Inputs'!F2,'Inputs'!G2))

    Note the ! in 'Inputs'!B2


    "Felicity Geronimo" wrote:

    > Hi,
    >
    > I have the following problem:
    >
    > I need use the following formula in a vba function: (but keep
    > failing)and then place the result in a text/prn file.
    >
    > =CONCATENATE('Inputs'!E2,'Inputs'B2,VLOOKUP('Inputs'!E2,EmpInfo!A:D,3,FALSE),"780",'Inputs'!F2,'Inputs'!G2))
    >
    > Eg.1
    >
    > E2 = 012 (text field, usually has leading zero)
    > E2 = 05050 ((text field, usually has leading zero)
    > Vlookup answer = " " (5 spaces)
    > F2 = 01012005 (date)
    > G2 = 2377000 (salary of 23770.00 - formatted)
    >
    > The result would be:
    >
    > 01205050 010120052377000
    >
    > Eg.2
    >
    > E2 = 010 (text field, usually has leading zero)
    > E2 = 12345(text field, usually has leading zero)
    > Vlookup answer = " " (6 spaces)
    > F2 = 05112005 (date)
    > G2 = 5555000 (salary of 555550.00 - formatted)
    >
    > The result would be:
    >
    > 01012345 0511200555555000
    >
    > I then need to do this for all the rows of data in the input sheet,
    > and then export the data as a text/prn file.
    >
    > Your help would be much appreciated.
    >
    > Kind Regards
    >
    > Flick
    >


+ 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