VBA Solution for Concatenate with two vlookup(s)

davidhbgh

New Member
Joined
Jun 21, 2005
Messages
14
I am using the code:

Code:
ActiveCell.Offset(0, 5).FormulaR1C1 = "=CONCATENATE(VLOOKUP(RC[-5],'Category-Cause'!R[-11]C[-5]:R[89]C[-3],3,FALSE),"",VLOOKUP(TallySheet!RC[-4],'Category-Cause'!R[-11]C[-4]:R[89]C[-2],3,False))"

I am getting the error 'Application-Defined or Object-Defined Error'

Any ideas as to what I am doing wrong?

Thanks, Dave
 

Some videos you may like

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,061
Office Version
  1. 365
Platform
  1. Windows
Not sure why you get the error but this works for me.
Code:
ActiveCell.Offset(0, 5).FormulaR1C1 = "=VLOOKUP(RC[-5],'Category-Cause'!R[-11]C[-5]:R[89]C[-3],3,0) & VLOOKUP(TallySheet!RC[-4],'Category-Cause'!R[-11]C[-4]:R[89]C[-2],3,0)"

Actually it was the "" in the formula.
Code:
ActiveCell.Offset(0, 5).FormulaR1C1 = "=CONCATENATE(VLOOKUP(RC[-5],'Category-Cause'!R[-11]C[-5]:R[89]C[-3],3,FALSE),"""",VLOOKUP(TallySheet!RC[-4],'Category-Cause'!R[-11]C[-4]:R[89]C[-2],3,False))"
 

Watch MrExcel Video

Forum statistics

Threads
1,118,799
Messages
5,574,387
Members
412,590
Latest member
Velly
Top