Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-08-2014, 08:00 AM
ketbdnetbp ketbdnetbp is offline VLookup Syntax Windows 7 32bit VLookup Syntax Office 2010 32bit
Novice
VLookup Syntax
 
Join Date: Apr 2014
Location: Chicago
Posts: 1
ketbdnetbp is on a distinguished road
Default VLookup Syntax

The following code is part of a loop but, it is not working. I believe its a syntax problem, any suggestions...
If Worksheets(iDSK2).Cells(intRow, 5).Text = "Associate" Then
Worksheets(iDSK2).Cells(intRow, 24).Select
ActiveCell.Formula = "=VLOOKUP(CONCATENATE(A" & intRow & ", "" "", B" & intRow & "),Sales!$A$6:$J200,4,FALSE)"
Else
Worksheets(iDSK2).Cells(intRow, 24).Select
ActiveCell.Value = "0.00"
End If
Dim valCheck As String


valCheck = Worksheets(iDSK2).Cells(intRow, 24).Text
If valCheck = "#N/A" Then
Worksheets(iDSK2).Cells(intRow, 24).Value = 0
End If
Reply With Quote
  #2  
Old 04-08-2014, 08:38 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline VLookup Syntax Windows 7 64bit VLookup Syntax Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,943
Pecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond repute
Default

I'm not versed in VBA ( and actually this is a non VBA forum) but what is CONCATENATE(A" & intRow & ", "" "", B" & intRow & ") supposed to do ?

Non VBA syntax is =concatenate(string1,string2, etc..) or without the concantenate function = string1&string2&...
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #3  
Old 04-12-2014, 03:18 PM
p45cal's Avatar
p45cal p45cal is offline VLookup Syntax Windows 7 32bit VLookup Syntax 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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using multiple formulas in one (IF, AND and SUM) gives syntax error markdeniet Word 1 02-05-2014 05:17 AM
VLookup Syntax Syntax to use OFFSET() in a cell formula? dlowrey Excel 3 07-09-2013 09:15 AM
VLookup Syntax Command line syntax for 2010 asearle Word 1 08-07-2012 05:42 AM
VLookup Syntax Syntax Help Needed for Using AND Statement in NEXIF robpgreer Mail Merge 10 08-11-2011 04:58 PM
VLookup Syntax Syntax help needed blazzercat Excel 3 07-09-2009 02:15 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:25 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft