VBA Newbie here; I have built a macro to copy data from one spreadsheet to another, compiling multiple sheets from the source workbook into a single sheet in the target workbook. However, the report that spits out the source workbook does not always have the same number of sheets. Is there a way in VBA to make a set of actions optional?
To further explain, the source workbook will nominally have 15 sheets to pull data from. However, if it has less, it will throw up an error and stop the rest of the macro from running. I need a way to make the steps of the individual sheets optional, so if the source workbook only has 13 sheets, it will skip steps 14 & 15 and finish running the macro.
To further explain, the source workbook will nominally have 15 sheets to pull data from. However, if it has less, it will throw up an error and stop the rest of the macro from running. I need a way to make the steps of the individual sheets optional, so if the source workbook only has 13 sheets, it will skip steps 14 & 15 and finish running the macro.