Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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('Input s'!E2,EmpInfo!A:D,3,FALSE),"780",'Inputs'!F2,'Inpu ts'!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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default 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('Inpu ts'!E2,EmpInfo!A:D,3,FALSE),"780",'Inputs'!F2,'Inp uts'!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('Input s'!E2,EmpInfo!A:D,3,FALSE),"780",'Inputs'!F2,'Inpu ts'!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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF VLOOKUP & CONCATENATE Tasha Excel Discussion (Misc queries) 7 November 14th 08 08:57 PM
CONCATENATE & VLOOKUP David Brereton[_2_] Excel Discussion (Misc queries) 4 August 28th 08 09:36 AM
Concatenate a VLOOKUP lehigh46 Excel Worksheet Functions 2 August 27th 08 08:58 PM
Vlookup & Concatenate? Saxman[_2_] Excel Discussion (Misc queries) 14 July 30th 07 02:24 PM
Can you use Concatenate with the If function with vlookup in the i simoneaux Excel Worksheet Functions 2 February 7th 05 08:45 PM


All times are GMT +1. The time now is 10:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"