Hello!
Thanks for reading my post.
I have a macro which is pasting formulas containing links to multiple cells in another excel spreadsheet.
The cells contain integer values and I am summing them up. In case one of the cells is empty, I get the final result as "Value#" so I tried to add the IF and ISError functions to the formula which represents the link to the other file:
"=" + IF(IsError(sFileName + "Sheet1'!$B$" + x),0,sFileName + "Sheet1'!$B$" + x) +"+" + IF(IsError(sFileName + "Sheet1'!$G$" + x),0,sFileName + "Sheet1'!$G$" + x)
Where:
[*] sfilename is a string representing the name of the file from which I am extracting the data[*] B and G are the different columns and x is a variable representing the different rows.
This way in case the value of a specified location is blank, then it will be treated as a zero otherwise it will appear as a normal link and the total sum will not be affected by a blank cell.
The problem is that the VBA compiler is displaying the error called " Compile Error, Expected = Expression.".
Can you please help me troubleshoot this error and tell me what I am doing wrong?
I will greatly appreciate it.
Thanks
Robby
Bookmarks