Hi all, very new to VBA and would appreciate any help. I've been stuck on a problem that I can't seem to get past no matter what I try.
I'm working with a file that has dozens of tabs. I have a calculation that dynamically sets a print range for each sheet in my workbook depending on the contents of that sheet. I am trying to develop a macro that will then delete all of the rows below where the print range ends in each sheet which will be a different row on each one.
Currently I have the Macro working only on my active sheet - and whenever I try to apply it to each sheet I get the error Method 'Range' of object '_Global' failed. I'm assuming that this is because of the reference to ActiveSheet in the VBA but whenever I try to replace it I am getting the 'Object Required' error.
I am completely stumped - would appreciate any help with this problem.
Attaching a snippet below - here it only deletes the rows on the Active Sheet and when I try to apply a for each worksheet in this workbook component I get the Method 'Range' of object '_Global' failed error - how can I successfully delete the rows on each sheet?
works on active sheet.PNG
Bookmarks