Hi,
I have an issue with activating a sheet from a user form, the same code works fine in Excel 2003 to Excel 2010, doesn't work with Excel 2013.
This is how to simply reproduce the issue:
Have a workbook with 2 worksheets in it, called Sheet1 and Sheet2 let's say, and some different data in both sheets, in same cells, to observe the issue better, and on Sheet1 have 2 buttons:
On click of Button1 activate Sheet2 worksheet using a Macro1 with 1 line in it:
ThisWorkbook.Sheets("Sheet2").Select
I can edit data in Sheet2 fine in this situation.
On click of Button2 call Macro2 which has 1 line:
UserForm1.Show
a UserForm1 pops up and on click of a CommandButton1 call same Macro1 like this:
Unload Me
Macro1
the Sheet2 worksheet is activated, sort of, but if I edit data in it, it actually updates corresponding cells in Sheet1, if I click on Sheet1 I can see data entered in there!
I tried also with Activate method instead of Select, same result, works fine for older Excel version, doesn't work with 2013.
Clicking back from Sheet1 to Sheet2 worksheet activates the Sheet2 sheet properly.
Has anyone seen such behaviour? If yes, are there any coding workarounds to properly activate Sheet2?
Thank you
I have an issue with activating a sheet from a user form, the same code works fine in Excel 2003 to Excel 2010, doesn't work with Excel 2013.
This is how to simply reproduce the issue:
Have a workbook with 2 worksheets in it, called Sheet1 and Sheet2 let's say, and some different data in both sheets, in same cells, to observe the issue better, and on Sheet1 have 2 buttons:
On click of Button1 activate Sheet2 worksheet using a Macro1 with 1 line in it:
ThisWorkbook.Sheets("Sheet2").Select
I can edit data in Sheet2 fine in this situation.
On click of Button2 call Macro2 which has 1 line:
UserForm1.Show
a UserForm1 pops up and on click of a CommandButton1 call same Macro1 like this:
Unload Me
Macro1
the Sheet2 worksheet is activated, sort of, but if I edit data in it, it actually updates corresponding cells in Sheet1, if I click on Sheet1 I can see data entered in there!
I tried also with Activate method instead of Select, same result, works fine for older Excel version, doesn't work with 2013.
Clicking back from Sheet1 to Sheet2 worksheet activates the Sheet2 sheet properly.
Has anyone seen such behaviour? If yes, are there any coding workarounds to properly activate Sheet2?
Thank you