M
Mark
I have the following code in a userform embedded into a template, which
prompts for input of certain variables in a word document:
Private Sub CommandButton1_Click()
With ActiveDocument
.Bookmarks("Report_Number").Range _
.InsertBefore TextBox1
.Bookmarks("Date").Range _
.InsertBefore TextBox2
.Bookmarks("Location").Range _
.InsertBefore TextBox3
.Bookmarks("Spool_Details").Range _
.InsertBefore TextBox4
.Bookmarks("Pump_Pressure").Range _
.InsertBefore TextBox5
.Bookmarks("Name1").Range _
.InsertBefore TextBox6
.Bookmarks("Name2").Range _
.InsertBefore TextBox7
.Bookmarks("Name3").Range _
.InsertBefore TextBox8
End With
UserForm1.Hide
End Sub
What I would like to do is change the insertion of the following to either a
dropdown box with 2 or 3 different names or checkboxes with the same 2 or 3
names.
.Bookmarks("Name1").Range _
.InsertBefore TextBox6
.Bookmarks("Name2").Range _
.InsertBefore TextBox7
.Bookmarks("Name3").Range _
.InsertBefore TextBox8
How do I go about this?
Also, when I record a macro, how do I get the cursor to allow me to point
and select text? All it does now is change to an arrow with a cassette button
that does not allow me to do anything that I can tell.
Thanks in advance.
prompts for input of certain variables in a word document:
Private Sub CommandButton1_Click()
With ActiveDocument
.Bookmarks("Report_Number").Range _
.InsertBefore TextBox1
.Bookmarks("Date").Range _
.InsertBefore TextBox2
.Bookmarks("Location").Range _
.InsertBefore TextBox3
.Bookmarks("Spool_Details").Range _
.InsertBefore TextBox4
.Bookmarks("Pump_Pressure").Range _
.InsertBefore TextBox5
.Bookmarks("Name1").Range _
.InsertBefore TextBox6
.Bookmarks("Name2").Range _
.InsertBefore TextBox7
.Bookmarks("Name3").Range _
.InsertBefore TextBox8
End With
UserForm1.Hide
End Sub
What I would like to do is change the insertion of the following to either a
dropdown box with 2 or 3 different names or checkboxes with the same 2 or 3
names.
.Bookmarks("Name1").Range _
.InsertBefore TextBox6
.Bookmarks("Name2").Range _
.InsertBefore TextBox7
.Bookmarks("Name3").Range _
.InsertBefore TextBox8
How do I go about this?
Also, when I record a macro, how do I get the cursor to allow me to point
and select text? All it does now is change to an arrow with a cassette button
that does not allow me to do anything that I can tell.
Thanks in advance.