View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sam Wilson Sam Wilson is offline
external usenet poster
 
Posts: 523
Default Execute code in a loop - Question

Hi Les, yes it is:

sub demo()

dim wb as work book
dim s as string
dim i as integer

s= "C:\Filepath\File.xls"

for i = 1 to 10
Set wb = Workbooks.Open(s, False)

'Write your code in here

wb.Close
next i

end sub


"Les" wrote:

Hello all, i am not a programmer so forgive the type of questions. Is it
possible to run code to manipulate a document if it is opened within a loop
and once finished the loop continues ?
--
Les