My goal here is to set up a macro template file for a report that generates a new workbook every day. The item list is fluid, changing daily. The 2 vlookup functions are used to show what comments were given in the previous day's report for each item, as well as calculate how many days each item has been on this report. The problem I am experiencing is with the first vlookup; using the IF(ISERROR combination, I wanted to show a blank cell in the case of an #N/A error (no previous data for a particular item), so that once the macro runs and sets up the report, it is easy for users to input comments for items newly added to the report. When attempting to run the macro for testing, utilizing the following code:
VBA errors out with run-time error 1004, "application-defined or object-defined error". As far as I understand the concept, "" should result in a blank cell when the vlookup formula produces an error value. The really interesting part is that if I use this formula normally without VBA, it works mostly ok with no error messages from Excel, with the exception that some cells still end up showing "0" instead of blank. So why does VBA not like this formula??Please Login or Register to view this content.
This is the section of code I'm currently testing. I can provide further snippets or the entire macro if requested. "cellAddress" is declared and defined earlier in the macro, and works the way it's supposed to in every instance. The reason for using that variable instead of a specific cell reference is that the list of items in this report is never the same amount, so the last row is always different.Please Login or Register to view this content.
Thank you for any and all help.
Bookmarks