I'm having a problem when adding new sheets to a Workbook from a UserForm. Basically whenever I add a new sheet, it appears to be linked to another sheet in the same workbook.
I have been able to reproduce this issue fairly easily by creating a new Excel file, then adding it a new userform with this code in it:
Private Sub UserForm_Click()
Sheets.Add
Call Unload(Me)
End Sub
If I open the userform from a sheet such as this one:
And then I double click the userform, the issue already happens.
The new sheet is works incorrectly. For example if I write on any cell of the new sheet I get the formatting from the original sheet. Worse still, if the original sheet is protected, I'm not allowed to write on the new sheet (though the ribbon shows it's unprotected).
If I select another sheet and select the new sheet again everything returns to normal. Am I doing something wrong? If it's a bug is there any workaround?
Here is an Excel file that produces the error: Drive.google.com
In Userform1's properties, change the ShowModal to False.
I was able to re-produce the behavior. I changed the ShowModal to False and the behavior changed to the expected behavior. I made no changes to any VBA code.
I'm running 64-bit Excel 2013 from MS Office Professional.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With