J
Jason Logue
Okay, I have posted similar queries on this same topic before, but I
don't think any of my previous posts really clarified my quandry.
Here is the main problem:
1) I have four main userform windows that users enter info into and
this info is inserted in bookmarked text within a template.
2) The user will need to access particular sub-divided sections in a
large manual at certain points during the userform entry process. I
placed a button that allows access to a first window with a listing of
all chapters in the manual. When they click on a chapter, they can
then click on a section number button (e.g. 1.1 is Chapter 1.1) and
that retrieves bookmarked sections (the 1.1. button retrieves the
bookmark Chapter1_1).
3) When the user clicks on the final section number button, the
bookmarked text is placed in the original main userform and in a
certain textbox next to the button they clicked on. So if they need
to insert text from the manual in a certain area, they will click on
the button next to the textbox.
4) Up until the final section number button, the code is simply a
series of Userformname.Show and PreviousUserform.Hide. Quite simple.
On the final button, though, the code is summed up in one line:
NameofUserform.Nameoftextboxtextisinsertedinto.Text =
Source.Bookmarks(nameofbookmarkedtext).Range
This is telling the button to retrieve the bookmarked text and insert
it in the named textbox in the named userform.
My main problem is that the userform and textbox must be variables,
else I have to repeat all the code over and over again for each
different textbox. There are only four userforms and there will
probably be around ten textboxes, but the bookmarks number above 100.
I apologize for essentially posting the same question three times, but
I felt like I never really made myself clear. I hope this helps.
TIA,
Jason
don't think any of my previous posts really clarified my quandry.
Here is the main problem:
1) I have four main userform windows that users enter info into and
this info is inserted in bookmarked text within a template.
2) The user will need to access particular sub-divided sections in a
large manual at certain points during the userform entry process. I
placed a button that allows access to a first window with a listing of
all chapters in the manual. When they click on a chapter, they can
then click on a section number button (e.g. 1.1 is Chapter 1.1) and
that retrieves bookmarked sections (the 1.1. button retrieves the
bookmark Chapter1_1).
3) When the user clicks on the final section number button, the
bookmarked text is placed in the original main userform and in a
certain textbox next to the button they clicked on. So if they need
to insert text from the manual in a certain area, they will click on
the button next to the textbox.
4) Up until the final section number button, the code is simply a
series of Userformname.Show and PreviousUserform.Hide. Quite simple.
On the final button, though, the code is summed up in one line:
NameofUserform.Nameoftextboxtextisinsertedinto.Text =
Source.Bookmarks(nameofbookmarkedtext).Range
This is telling the button to retrieve the bookmarked text and insert
it in the named textbox in the named userform.
My main problem is that the userform and textbox must be variables,
else I have to repeat all the code over and over again for each
different textbox. There are only four userforms and there will
probably be around ten textboxes, but the bookmarks number above 100.
I apologize for essentially posting the same question three times, but
I felt like I never really made myself clear. I hope this helps.
TIA,
Jason