I am having trouble updating a sheet reference in a database.
The format of my formula is like so:
=(SUMIF('Raw Data'!$B:$B,"P0900",'Raw Data'!D:D))
I want to write a macro to update the "Raw Data" worksheet so that a new one will be created according to the selected date (and it will be renamed correspondingly).
I tried to use the indirect function so that the formula becomes
=(SUMIF(indirect(raw_data_sheet_name&$B:$B),"P0900",indirect(raw_data_sheet_name&$D:$D))
where raw_data_sheet_name changes based on the date.
This method would work except that I have thousands of cells to update. I tried using the find and replace function in excel but it doesn't work since it would make the formula incomplete.
Is there a macro I can use to solve this?
Thanks!
Bookmarks