In this video, I explain how I created a document that utilizes a userform in MS Word using the Developer tab and Visual Basic.
Пікірлер: 100
@Tahehe3 жыл бұрын
Thank you so much for this. I have created several template documents I use all the time with your help. It has saved me hours of manually inputting names and dates that I would always miss before.
@fekrabusinesssolutions10 ай бұрын
2023. And ur video rocks! Thanks a lot!
@ScottPantall9 жыл бұрын
Thank you for this video! Your example led me to FormFields which I'm using in my Word 2013 document instead of Bookmarks. I never would have arrived at this solution without your video.
@nickdenton2107 жыл бұрын
Hi, in your first line of code what is "lname"? If is the Bookmark name what is "fname" doing in the next line? I am very confused. I thought the Bookmark name was the one in brackets? And what is the Me in the Me.TextBox1?
@onihonker9 жыл бұрын
Thank you for teaching me how to do this. We use Word to print labels for our moulding samples and typing out a different stain color each time we need a new label is tedious.
@IanWitts11 жыл бұрын
Great tutorial, thank you. I'm actually stuck on how to use one of the values a user has entered multiple times within a document i.e. enter a name once and use that name multiple times. If you have any thoughts on that it would be much appreciated.
@LearningEngineercom3 жыл бұрын
You hit the nail on the head. You can't use one variable multiple times. You have to create a new variable for every one of the places you want to go. This seems inefficient, but it's just Microsoft.
@1234567mrbob2 жыл бұрын
It doesn't work for me. When I create a form (UserForm1) and call it from autonew (Userform1.Show). I get the error "424" Object not found.
@rachaelbackdoor48723 жыл бұрын
It would be nice if this tutorial began by informing the viewer you must have significant knowledge and experience with these specific operations to understand what is happening.
@LearningEngineercom3 жыл бұрын
I see your point, but the video is only six minutes. The description of the video does tell the view that Visual Basic will be used.
@LearningEngineercom5 жыл бұрын
You have to go into Visual Basic under the developer tab. The name of the form should be in the list on the left.
@IanWitts11 жыл бұрын
Thank you for the swift response! In Word 2013 it *appears* to take the formatting of the initial bookmark and copy it to all cross-referenced areas. That said, it's probably just me being stupid!
@lisamykytik49027 жыл бұрын
Is there a way to have a UserForm created with a Submit button, that when clicked will enter the entire contents of the UserForm into my Word Document? (including not just textboxes, but also radio buttons, checkboxes & labels)
@LearningEngineercom7 жыл бұрын
Yes
@daltonhubbard78433 жыл бұрын
Before I go too far down the rabbit hole is there a way to set a bookmark within a one of these? If not, there may be a better way to do what I want to do. I want to include a certain section only in certain circumstances, but that section also contains text that I'd like to autofill. I.e. if my report requires the inclusion of a common element and that common element contains a variable such as a report outlining say the use of a plot of land, I say farm, it autofills a wall of text about farms, and then I also want to say specifically cattle versus horses or sheep within that wall of text.
@coopercreativemedia67203 жыл бұрын
Super helpful... Can't thank you enough brother
@bomberbrown87909 жыл бұрын
For multiple entries of the same data, I tried copying the Bookmark to an additional location but this just removes the original bookmark. Do I need to change the Range in someway?
@JK-hm3lf4 жыл бұрын
I am using Word 2010. I have created macro enabled template to fill students form using info by you in this video. Now I wanted: 1: to use saveAs command such that the fileName becomes value in textbox1. 2: to make the document ready for the next student, after saving the first one. Please guide how can I do these?
@icysaracen30542 жыл бұрын
Can you help me with my assignment. This is what I have to do: •An application is needed to customise the footer of report documents with the user’s department name: He would like you to incorporate the use of a VBA form. The user must be offered a choice of departments (including an option for the Director), with the selected Department being added to the footer without destroying the text already in the template’s footer.
@Ramp10er8 жыл бұрын
Thanks for these tutorial. I love VB but making codes gives me a hard time. I like exploring... How to clear the document if I want another data to be formatted? Let's just add a clear button if client made a mistake or for you instead makes editing...
@Tom-iv9zv5 жыл бұрын
Could I use the 'userform1.show" in a macro button to make the form pop up at the click of a button?
@kaushalchauhan42093 жыл бұрын
How can i clear the bookmarks without deleting them if i want to add information for a second time ?
@BradScript2 жыл бұрын
How, then, do I then get data I set up in a text box to repeat elsewhere in the same template {REF textboxname} does not work, including in the header? Further, how can I populate this data across multiple templates? I've been banging my head for the entire workweek searching and trying out solutions. I'm trying to create a user form that will populate data 1) across multiple templates, 2) populate some of the data the user entered into a header/footer, and 3) populate the user=entered data in such a way that it repeats in the same template. I've followed your instructions on this video to create the form thus far (everything works except repeating a data field or applying that data into a header and second template).
@LearningEngineercom2 жыл бұрын
Ok. You have several issues going on here. First, for each bookmark in the document that you want to insert data into, you have to have its own variable and has to be loaded separately from the form item. If this seems dumb, it is. Second, it is unlikely that it will load into multiple templates, but I could be wrong. I would send the data to a text file on the computer that the other templates read from. See this video. kzbin.info/www/bejne/lYHSh5Wgos9_l7s
@kylempd9 жыл бұрын
Cant get my bookmarks to work I can type in but add button stays grey. Ive open and saved as macro WB. Im lost this is harder than excel!
@wazzym2903 жыл бұрын
Does anyone know where to get my submit box to get those scripts? Do i type them manually?
@LearningEngineercom3 жыл бұрын
This document should work learningengineer.com/cloud/docs/Automated%20APA%20Form%20Document.docm
@stephaniepravaz96609 жыл бұрын
Thank you so much Le. But my userform isnt working. I keep getting error 424, What did I do?
@autumnrita12345 жыл бұрын
Can you repeat a bookmark for 2 different locations in your document but yielding the same value from inserted information?
@LearningEngineercom5 жыл бұрын
Yes and no. Yes, you can repeat information from once source; however, the bookmarks have to have their own unique names.
@lagusgoudas27052 жыл бұрын
hello how to feed a listbox on UserForm word vba 'Thank you for everything'
@I3lackDragon7 жыл бұрын
How can I create more than 1 indicator? For example for Name I want to have 2 outputs. Name: Ryan So "Ryan" was doing this and the "Ryan"... Thanks a lot.
@LearningEngineercom7 жыл бұрын
Create another bookmark and in the code send the input to it as well.
@I3lackDragon7 жыл бұрын
It worked! Thanks a lot! As you explained to me: Dim Nome2 As Range Set Nome2 = ActiveDocument.Bookmarks("Nome2").Range Nome2.Text = Me.TextBox1.Value
@alejandroatencio088 жыл бұрын
wow! You are the best! Thank for the video!
@vt8victory6 жыл бұрын
Is there anyway that I can make 01 userform and use it for 3-4 document files?
@jannatfatima66425 жыл бұрын
Bookmarks disappear after successfully running the userform the first time. How to fix this?
@MissM6899 жыл бұрын
Thanks! How do you create the "submit" button?
@educationhub82415 жыл бұрын
How to open ms word in form1 or child form or richtextbox or panel box whatever and save vb btn automatic in specific drive
@bargains34874 жыл бұрын
Thansks for your great tutorial! This used to work for me, now it won't open as macros have been disabled or something? I'm in Spain and of course word here is in Spanish so can't figure out what to do? Any advice? :)
@LearningEngineercom4 жыл бұрын
You have to enable macros in your security settings in Word or when you save the file.
@bargains34874 жыл бұрын
@@LearningEngineercom Thanks! Yes, I have been trying to figure this out in Spanish haha! It's really difficult to find the correct settings in English so I can try and figure it out in Spanish for Window 7/Word 10? I'll keep looking for a good tutorial. Thanks for your time! :)
@Ramp10er8 жыл бұрын
How to clear the text you have input in the textbox ? I can't figure out the code...
@LearningEngineercom8 жыл бұрын
+Ramp10er Create a button and in the button's code like at 4:44, lName.Text = "" fName.Text = "" cName.Text = "" iName.Text = "" hlName.Text = "" Me.Repaint
@Ramp10er8 жыл бұрын
+LearningEngineer.com Code not working... But the code on your video does work...
@LearningEngineercom8 жыл бұрын
+Ramp10er Sorry, that clears the text boxes. Use ALL the same code from 4:44 except for replacing all the Me.TextBox2.Value with an empty quotes like the previous code I provided.
@MultiMilton2510 жыл бұрын
how can i round an answer like ,153 to 0,153??? I was looking on the web for an answer but cant find any:( (word vba)
@nkt208806 жыл бұрын
Thank you for making this video
@hounamao71405 жыл бұрын
how can I reopen the userform once I've submitted it once, on the user side. To edit some of the forms for instance.
@LearningEngineercom5 жыл бұрын
When it opens, don't let it run the macro.
@adrianruizgonzalez20288 жыл бұрын
Thank for your help bro I owe you one. Greetings
@nickdenton2107 жыл бұрын
hi, how do you know what code to write in the Command Button form?
@jacobmarkarian5 жыл бұрын
How do I go back to the userform to make some edits? I'm lost
@Nofanization6 жыл бұрын
Hi Can you make a tutorial how to input a text from visual basic, based on formula on visual basic?
@crudecod5 жыл бұрын
thank you for the video. Are you also an airline pilot ?
@aminamuhsen4094 жыл бұрын
Type the names of the 5 windows you use that represent Userform? please answer 🥺
@tuaparulian49758 жыл бұрын
Hi learning engineer, What should we do to make the userform dialog box appear at 0:30? Do we have to save the doc that we create in macro enabled or in template? I'd appreciate your reply. I"m a real novice. Thanks man.
@LearningEngineercom8 жыл бұрын
+Tua Parulian Yes, you have to change your security settings to get it to come up and save it as a template. At 5:23 it shows you the code.
@tuaparulian49758 жыл бұрын
+LearningEngineer.com Thanks for your reply, but I still don't know where we can change the security setting. Can you tell me?
@LearningEngineercom8 жыл бұрын
+Tua Parulian It should be under the Developer tab or in the Trust Center which is under Options.
@tuaparulian49758 жыл бұрын
Fantastic, I'll try that. Thanks a lot, LearningEngineer.
@tuaparulian49758 жыл бұрын
Hi LE, I tried as per your comment but I didn't see the security thing you mentioned in the trust certificate. It looks like your video is for people who are already familiar with the basics. Would you do a step by step video on how to make that dialog box appear so we can simply type in and the info will show in the doc just like what we see? I'd be thankful. I want to make a template so my colleagues can simply use it and type in the info without having to copy and paste table which is really annoying. I just want to help simplify my friends work on preparing report on student's progress, and mine, that's all. If you could help on that, I'd be thankful.
@linden176310 жыл бұрын
Hi, I'd like to first say thanks for the great video, was very helpful. Do you know how to do the following: 1. I have the dialogue open each time the document is opened but if I fill in the dialogue box the second time it doesnt delete the original text, instead it adds the new text to the old text, can I make it delete the old text if new text is entered? 2. How can I reference this bookmark text elsewhere in the document? If I try inserting a field for "Ref" and select the bookmark it comes out blank, same goes for using cross reference
@linden176310 жыл бұрын
Or is there a way to use this form tutorial to change the "custom document properties"
@LearningEngineercom10 жыл бұрын
If you copy the bookmark and put it elsewhere using the same reference name, it should put in the same information as the first input.
@linden176310 жыл бұрын
LearningEngineer.com Do you know if it is possible to use the UserForm to edit/update "Custom Document Properties"
@linden176310 жыл бұрын
LearningEngineer.com I worked it out, thanks for the quick response. If anyone else wants to create a UserForm to edit "Custom Document Properties" follow the KZbin video above but for the Private Sub Code use the following code and copy the ".Custom" line for as many properties as you require: Private Sub CommandButton1_Click() With ActiveDocument .CustomDocumentProperties("Project Number").Value = Me.TextBox1.Value UserForm1.Hide .Fields.Update End With End Sub
@nickc17599 жыл бұрын
LearningEngineer.com Linden Bromwich How exactly do you copy the bookmark?
@flynnbonser621410 жыл бұрын
Great video but im having this error where i click my submit button but it says Compile error : Invalid use of property and i click ok on it and it brings me up to the properties of the submit button and highlights the words Private Sub CommandButton1_Click() -Please Respond if you can
@jopedder7 жыл бұрын
I found this a little difficult to follow, having to rewind and rewatch multiple times - it looks like the guy is using keyboard shotcuts to selct items on the screen without saying so, as he says things like this will create x, but the cursor is in the wrong place and you can only tell that something has changed by noticing a tiny icon looks a little different! Got there in the end though!
@LearningEngineercom7 жыл бұрын
I have a new video that I created on this topic at kzbin.info/www/bejne/nWatZaeGobNgqa8
@theolaross256910 жыл бұрын
I want to preserve my form from edits but allow the user to insert text and print it and save as a copy. If I password protect it I get the following error message, "Run-time error '6124': You are not allowed to edit this selection because it is protected.". What is the best way to do this? Should I have it open as a copy?
@LearningEngineercom10 жыл бұрын
Yes, you can open it as a copy, or you have to change the security settings.
@theolaross256910 жыл бұрын
LearningEngineer.com How would I do so without allowing the user to change the original document. How would I, for example, have the user open and fill out the form and not give them save as copy and/or print it? The original would stay as is. Thank you
@theolaross256910 жыл бұрын
Theola Ross I should have said ..not allow them to save to the original form. They would save as copy and/or print it? Thanks again.
@LearningEngineercom10 жыл бұрын
Theola Ross You simply need to save your original document as a template, which won't let them save it as the original.
@theolaross256910 жыл бұрын
LearningEngineer.com I saved it as .dotm, changed the security warning "Macros have been disabled", and resave it. I went into the Trust Center and selected "Trute access to the VBA project object model". Idon't get the form fields after saving.
@chauchanhsaly6 жыл бұрын
Could you create user and password on file word ???
@LearningEngineercom6 жыл бұрын
I don't see why not. You would want something like this: kzbin.info/www/bejne/lYHSh5Wgos9_l7s&lc=
@adiltheprodigy82357 жыл бұрын
Good video but how to erase the last data when you put a new data
@LearningEngineercom7 жыл бұрын
You would need to clear the bookmark. Instead of attaching the variable like lName.Text to a text box just clear it with a null value, such as lName.Text = ''. Then repaint the document.
@adiltheprodigy82357 жыл бұрын
LearningEngineer.com OK i will try thank you
@veasnalim1ify6 жыл бұрын
LearningEngineer.com
@crispy21027 жыл бұрын
Maybe I am missing something but what kind of object is "Me"?
@T4ish07 жыл бұрын
The code is NOT within worksheet or module, it is contained in UserForm1 object, so in any procedure used within this object, instead of UserForm1, you can use "Me".
@rebeccaadams15665 жыл бұрын
Not easy to follow at all - jumps all over the place - not good for a beginner
@LearningEngineercom5 жыл бұрын
I also have another video that covers the same information which you might find easier to understand: kzbin.info/www/bejne/qZ23dat_jNuBepI