![]() |
|
|
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
||||
|
||||
|
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
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) |
|
|
|
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 |
Syntax to use OFFSET() in a cell formula?
|
dlowrey | Excel | 3 | 07-09-2013 09:15 AM |
Command line syntax for 2010
|
asearle | Word | 1 | 08-07-2012 05:42 AM |
Syntax Help Needed for Using AND Statement in NEXIF
|
robpgreer | Mail Merge | 10 | 08-11-2011 04:58 PM |
Syntax help needed
|
blazzercat | Excel | 3 | 07-09-2009 02:15 PM |