I have created a complex spreadsheet that extracts certain worksheets
and modules and creates another workbook which is subsequently emailed
using Outlook to a list of individuals. It is not a complete copy of
the original workbook as there is information which must not be sent
out.
However I have been experimenting with using an input userform which
works great on the original worksheet but I cannot fathom out how to
send a copy of the userform together with the userform coding across
to the created worksheet which is to be emailed.
I found out how to send the module across using the following VBA
coding:-
' export module1 to file ready to be imported into copy of
spreadsheet
With ActiveWorkbook
FName = .Path & "\exportmodule.bas"
.VBProject.VBComponents("Module1").Export FName
End With
' move to new copy of spreadsheet
Set Destwb = ActiveWorkbook
'import Module 1 to new worksheet
ActiveWorkbook.VBProject.VBComponents.Import FName
Can anyone point me in the right direction for copying the userform
across using VBA
Brian Jermain
Scotland
--
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links :
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
To post to this group, send email to [email protected]
<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel