+ Reply to Thread
Results 1 to 2 of 2

Blank cell errors in formula containing links to a different excel file

  1. #1
    Registered User
    Join Date
    07-23-2007
    Posts
    20

    Blank cell errors in formula containing links to a different excel file

    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

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Blank cell errors in formula containing links to a different excel file

    Robby

    1) Can you please move this post to the excel programming forum, not the excel worksheet functions.

    2) Can you also attach an example workbook and include your code so we can see what you are trying to do. Make sure it is set up with enough structure, example data etc. to be workable, and enough of the code to replicate your problem. Fill any variables etc.

    rylo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1