Module In Visual Basic

P

Patrick Molloy

manually? in the code editor (the IDE) - you can open it with Ctrl+F11
from the Insert menu, select Module
 
J

Jacob Skaria

Are you looking for this... Launch VBE using Alt+F11. Insert module

If this post helps click Yes
 
P

Patrick Molloy

if you want to do it in code, its also relatively straightforwards...


Sub AddAModule()
Dim md As Object
Dim wb As Workbook
Set wb = Workbooks.Add

' you can (a) programatically add a module
Set md = wb.VBProject.VBComponents.Add(1)

and also (b) import a text file as a module
Set md = wb.VBProject.VBComponents.Import("{full address here}")

With md

'blah

End With

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top