hello,
I'm trying to use as a cell formula a user-defined macro myMacro
Public function myMacro() as integer
ActiveWorkbook.Sheets("Sheet2").Cells(1,1).value = 3
myMacro = ActiveWorkbook.Sheets("Feuil2").Cells(1,1).value
end function
in a cell of Sheet1, with the formula " = myMacro() "
This does not work, as execution of myMacro() is always in error at line 1 (trying to set the value of cell(1,1) of Sheet2) with error 1004.
It seems that when executing a user-defined macro in a cell's formula, the application locks all the sheets, then forbidding the modification of their content, as the macro tries to do.
Is there a way to make this macro work?
I just can't figure out where is the mistake!
Thank you for your help.
Jérôme
Bookmarks