Neither you are passing a parameter
nor are you getting a value returned
. In that case, it's not useful to have a function
but a Subroutine
.
Are you calling this function on Worksheet changed
or Cell changed
events? Please use Application.EnableEvents = False
when triggering functions on above events. You have to turn events off or it will keep repeating itself dragging into an infinite loop.
And then in the change event
turn events back on.
References: