View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
zapatista66[_12_] zapatista66[_12_] is offline
external usenet poster
 
Posts: 1
Default Declare Variable


Just to be sure I'm right:

First I write:

Option Explicit
Global gwksZap As Worksheet
Sub SetRefs()
Set gwksZap = ThisWorkbook.Worksheets("Zapatista66")
End Sub

in a module or in each module I need those variables ?

After:

Private Sub Workbook_Open()
Call SetRefs
gwksZap.Activate
End Sub

Finally:

All my declaration in the worksheet (Microsoft Excel Objet) like that:

Set wbBook1 = Workbooks("Logiciel_Production_Soumission.xls")
Set wbBook2 = Workbooks("Projets.xls")
Set wbBook3 = Workbooks("Liste_Prix.xls")
Set wbBook4 = Workbooks("Clients.xls")
Set wbBook5 = Workbooks("Template_Soumission.xls")

thanks for helping m

--
zapatista6

-----------------------------------------------------------------------
zapatista66's Profile: http://www.excelforum.com/member.php...fo&userid=1195
View this thread: http://www.excelforum.com/showthread.php?threadid=26698