Hello everyone,
I am attempting to run a routine that will clear certain cells given the appearance of text in a cell. The code itself runs fine for single worksheets that the words "Unit Cost" appears. However, in an attempt to have it run through all worksheets in a workbook, I get an error "Run-Time error '91': Object Variable or With block variable not set" once it gets to a worksheet that the phrase "Unit Cost" does not exist, and will not continue.
What can I add/modify to the code below in order for it to ignore worksheets where that phrase does not appear, and continue on with additional worksheets (and additional workbooks in the specified directory)?
My end goal is for the routine to run through all of the workbooks in the directory and update/save with the newly cleared cells.
Bookmarks