View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Costanza Costanza is offline
external usenet poster
 
Posts: 3
Default Loop through all open workbooks except Personal.xls

Hello,

I'm really inexperienced in VBA and I need to execute a sub procedure
in all open workbooks except in Personal.xls, but I'm having trouble
coding this.
What am I doing Wrong? Or maybe there's an easier way to do this

Here it is what I have:

Sub nome_cenario()

Dim wkb As Workbook

For Each wkb In Workbooks

If wkb.name = "PERSONAL.xls" Then

Next wkb

Else

Call Myprocedure

Next wkb

End Sub