View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Passing variables between forms

Hi Sam82,

Can this be situated in the "ThisWorkbook" section, because the macro
runs automatically on startup?


No, the global Vendor variable should be declared at the top of a standard
module.

Should you wish to initialise the Vendor variable in the workbook's opening
event, try (in the ThisWorkbook module):

Private Sub Workbook_Open()
Vendor = "Joe Bloggs Inc"
End Sub

---
Regards,
Norman



"Sami82" wrote in
message ...

Thank you for your speedy reply,

Can this be situated in the "ThisWorkbook" section, because the macro
runs automatically on startup?


--
Sami82
------------------------------------------------------------------------
Sami82's Profile:
http://www.excelforum.com/member.php...o&userid=27111
View this thread: http://www.excelforum.com/showthread...hreadid=474024