Hindu has attended:
Excel VBA Intro Intermediate course
Excel Advanced course
Initialise
Hello,
I am having problem intialising a UserForm on when document opens. And also I cannot make the command button work. I am trying to do a form and I want the form to open when initialise and to fill in the form then it actully fills in the actual word/excel form. I have inserted bookmarks but when I press cmd OK nothing happens.
Regards
Hindu
RE: Initialise
Hi Hindu
Thanks for getting in touch. For the first part, you have to insert a macro at the Workbook level. This wouldn't have been covered on a standard VBA intro / intermediate course.
In the VBE, above where the Forms are stored in Project Explorer, there is an object called "ThisWorkbook". Double-click this and add code like this:
Private Sub Workbook_Open()
UserForm1.Show
End Sub
...where UserForm1 is the name of your form. This will bring up the form on first load.
For the second part, what code have you put behind the OK button? It may be useful to paste that code in your reply.
Kind regards
Gary Fenn
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
Will be marked as resolved in 5 days
Notice: This is an automated message. Due to inactivity, this forum post will be marked as 'resolved' if there are no further responses in the next 5 days.