Share via

Adding Worksheet, "Won't Work On Multiple Sections" Error

Anonymous
2024-08-23T10:05:38+00:00

My macro is instructed to add a worksheet. VBA is throwing error "This won't work on multiple selections". Nothing is being copied. Nothing is selected. All the macro is instructed to do is add a worksheet. What could be causing this on-the-face-of-it illogical error? Thank you.

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2024-08-23T19:08:51+00:00

    Not really. As you can see, I fetch data from another workbook. Three further points. (1) In the two cases from this morning, I am sidestepping the issue by using an existing sheet. (I am creating temporary sheets to do calculations.) (2) I am testing and re-running macros over and over again. This issue popped up once in the more than dozen times on one macro. Every other time, no problem. Inconsistent. (3) I see that I cannot even add a worksheet manually while the error is displaying. I can create a new workbook and import into my workbook, providing another possible workaround. The reason most given for not being able to add a sheet is workbook protection. I password protect the sheets in the workbook but do not protect the workbook. Is Excel somehow protecting the workbook? I have seen Excel doing strange things lately. For example: colleagues run into a pop-up asking for the password on the protected sheet. All the macro did was unhide a sheet and hide the other (the unhide being password protected). I did all sorts of things but it is clear that Excel is somehow--on its own--tying to touch the protected sheet outside of my macro code. This does not happen to me ever. Inconsistent. Thank you again.

    Was this answer helpful?

    0 comments No comments
  2. HansV 462.6K Reputation points
    2024-08-23T12:51:09+00:00

    Could you create a stripped-down copy of the workbook demonstrating the problem (without sensitive information) and make it available through one of the websites that let you upload and share a file, such as OneDrive, Google Drive, FileDropper or DropBox. Then post a link to the uploaded and shared file here.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2024-08-23T12:08:15+00:00

    This is not the case--unless non-visible sheets are somehow being selected? Only one visible sheet (of two) is selected. This is something that has suddenly started to happen. The macro worked without error days before (new code). It occurs in this workbook in another macro (again, suddenly). In other macros I add sheets and no error occurs. Here is the code and the error point. Thank you.

    Was this answer helpful?

    0 comments No comments
  4. HansV 462.6K Reputation points
    2024-08-23T10:54:50+00:00

    Apparently. more than one sheet has been selected. Check whether the title bar of the workbook window contains the word Group.

    If so, select another sheet, or right-click one of the selected sheet tabs, then select Ungroup Sheets from the context menu.

    Was this answer helpful?

    0 comments No comments