0
The intention is that by clicking on the Sintese Euro tab, the macro would impute the "L" character in cell D1 of the Synthesis Local tab and then return to the Euro Synthesis tab. I was able to solve the error problem by imputing the macro in the module. So I just inserted a command in the Sintese Euro page to call the macro:
Then on the Euro Synthesis page I entered the code:
Private Sub Worksheet_Activate()
Call Module1.Macro1
End Sub
In the Module I inserted the macro code
Sub Macro1()
Sheets("SINTESE_LOCAL").Select
Range("D1").Select
ActiveCell.FormulaR1C1 = "L"
Sheets("SINTESE_EURO").Select
End Sub
The problem is how I used the command Private Sub Worksheet_Activate()
, he understands that all the ways to access the guide can trigger the macro, and how I put the command Sheets("SINTESE_EURO").Select
, in Macro he ends up in looping.
Is there any function that activates only when I click on the tab and not in all ways to access it as is the case of Private Sub Worksheet_Activate()
?
And that’s the line of error:
Range("D1").Select
Thank you, guys.
Where are you entering the code
Private Sub Worksheet_Activate()
? In a module? Could you insert a print of the VBA Project Tree.– danieltakeshi
So, I don’t understand anything even of VBA, but the code is inside the "Microsoft Excel Objects".
– Mariana Bayonetta
The event is being triggered in the right way. Does cell D1 have a Listbox or is it a common cell? Because a test with this code was performed and worked correctly.
– danieltakeshi
So the cell has a listbox yes.
– Mariana Bayonetta