Writing variable to document

  • Thread starter Patrick Simonds
  • Start date
P

Patrick Simonds

I have a DialogBox with a number of OptionButtons. Each OptionButton has
the following Code (the variable Name = changes depending on which
OptionButton is selected):


Private Sub OptionButton1_Click()

Dim Name

If OptionButton1 = True Then
OptionButton5 = True
End If

If OptionButton1 = True Then
Name = "Patrick"
End If

End Sub


What I need to know is, how do I place the value of varible Name (in this
case Patrick) in front of the BookMark Name? I tried the code below, but I
get an "Invalid or unqualified reference" error msg.


Private Sub CommandButton1_Click()

..Bookmarks("Name").Range _
.InsertBefore Name

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