Questo è codice VBA, ti sposto nel forum più adatto.