Does anyone know how best to acheive the following? I guess it would have to be done with coding.
I need to insert a formula into a particular cell if the worksheet is contained within the workbook. I've attached a workbook to aid my explanation.
For example, in my workbook you will see that there are only 4 worksheets, namely 'Master', '20', '40' & '60'. The Master worksheet will always be present but there may be more or less each time this workbook is created.
The routine would need to check what worksheets were present, with the exception of 'Master' and insert the following formula into the associated cell.
The routine would then continue to input formulas for the remaining worksheets. The formula and cell will obviously change for each worksheet. For example, '40' would be
If the worksheet(s) were not included in the workbook then "Not Required" would be inserted into the corressonding cell on the 'Master' worksheet.
In short,
Check which worksheets exist.
Insert formula into associated cell on 'Master' if worksheet exists.
Insert text "Not Required" if worksheet doesn't exist.
Any advice gratefully received.
Bookmarks