Thread: [Solved] VLookup Syntax
View Single Post
 
Old 04-12-2014, 03:18 PM
p45cal's Avatar
p45cal p45cal is offline Windows 7 32bit Office 2010 32bit
Expert
 
Join Date: Apr 2014
Posts: 956
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

try:
Code:
  If .Cells(intRow, 5).Text = "Associate" Then
    .Cells(intRow, 24).Formula = "=VLOOKUP(CONCATENATE(A" & intRow & ", "" "", B" & intRow & "),Sales!$A$6:$J$200,4,FALSE)"
    If .Cells(intRow, 24).Text = "#N/A" Then .Cells(intRow, 24).Value = 0
  Else
    .Cells(intRow, 24).Value = "0.00"
  End If
End With
but…
wouldn't, in cell X7 (just as an example row) the formula:
Code:
=IF(E7="Associate",IFERROR(VLOOKUP(CONCATENATE(A7, " ", B7),Sales!$A$6:$J$200,4,FALSE),0),0)
do the same thing without any vba at all?
Reply With Quote