<font face="Consolas," "lucida="" sans="" typewriter",="" console",="" "courier="" new",="" monospace="">This is a very basic version of a macro that would do the type of activity you are describing. Note that it does not have any kind of error handling. So if a sheet is missing, the execution will stop and you will be thrown into the debugger.
Questa è una versione di base di una macro che avrebbe fatto il tipo di attività che si sta descrivendo. Si noti che non ha alcun tipo di gestione degli errori. Quindi, se un foglio manca, l'esecuzione si ferma e si sarà gettato nel debugger.
<font face=Consolas, "Lucida Sans Typewriter", "Lucida Console", "Courier New", Monospace><SPAN style="color:#00007F">Sub</SPAN> Example1()<br><br> <SPAN style="color:#007F00">'// extremely basic</SPAN><br><br> <SPAN style="color:#00007F">Dim</SPAN> celItem <SPAN style="color:#00007F">As</SPAN> Excel.Range, _<br> wsTarget <SPAN style="color:#00007F">As</SPAN> Excel.Worksheet<br> <br> <SPAN style="color:#00007F">For</SPAN> <SPAN style="color:#00007F">Each</SPAN> celItem <SPAN style="color:#00007F">In</SPAN> Worksheets("Start").Range("A5:A500").Cells<br> <br> <SPAN style="color:#00007F">Set</SPAN> wsTarget = Worksheets(celItem.Value)<br> <br> RepeatedProcedure wsTarget<br> <br> <SPAN style="color:#00007F">Next</SPAN> celItem<br> <br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br><br><br><SPAN style="color:#00007F">Sub</SPAN> RepeatedProcedure(<SPAN style="color:#00007F">ByRef</SPAN> wsTarget <SPAN style="color:#00007F">As</SPAN> Excel.Worksheet)<br><br> <SPAN style="color:#007F00">'// This would be the procedure that you wish to</SPAN><br> <SPAN style="color:#007F00">'// execute for each worksheet on the list.</SPAN><br> <SPAN style="color:#007F00">'</SPAN><br> <SPAN style="color:#007F00">'// For demonstration purposes this routine just</SPAN><br> <SPAN style="color:#007F00">'// changes the color of the first four cells.</SPAN><br> <br> <SPAN style="color:#00007F">With</SPAN> wsTarget.Range("A1:B2").Interior<br> <SPAN style="color:#00007F">Select</SPAN> <SPAN style="color:#00007F">Case</SPAN> .Color<br> <SPAN style="color:#00007F">Case</SPAN> vbCyan: .Color = vbYellow<br> <SPAN style="color:#00007F">Case</SPAN> vbYellow: .Color = vbGreen<br> <SPAN style="color:#00007F">Case</SPAN> vbGreen: .Color = vbRed<br> <SPAN style="color:#00007F">Case</SPAN> vbRed: .Color = vbBlue<br> <SPAN style="color:#00007F">Case</SPAN> Else: .Color = vbCyan<br> <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Select</SPAN><br> <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br> <br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>