I'm trying to write a macro that searches for the string " Total" in a column of text and once it finds that text, replaces it with "" and performs a variety of functions around that cell including adding rows above and below and formatting cells around it before searching for the next iteration of " Total". The code works fine until there are no more instances of " Total" to be found, at which point the macro stops and I receive the error "Run-time error '91': Object variable or With block variable not set."
I've searched online for a solution to why this isn't working in my macro, but can't find the right combination of code to make my macro work. The pertinent part of my code is below. (The lines showing just a period are used to dramatically shorten the code.)
Bookmarks