View Single Post
 
Old 08-17-2020, 05:49 PM
Kindyr Kindyr is offline Windows 10 Office 2019
Novice
 
Join Date: Aug 2020
Posts: 12
Kindyr is on a distinguished road
Default Naming a variable using userform fields

Hello, I am wanting to create a persistent variable in a Word document that is based off of a userform. Basically, a user will a form, fill it out and at a later point, information from that userform will be used to print something else. So we will say they have two boxes to fill out with simple information. Those boxes will be EVParty (PartyTypeList) and EVNum (EvidenceID). I want to name a variable with the input from those two boxes. Here is what I have so far:

Dim EVParty As String
EVParty = PartyTypeList.Value
Dim EVNum As String
EVNum = EvidenceID.Value
Dim EXHIB As String
EXHIB = EVParty & EVNum


Now, I want to name a variable with the value that is EXHIB. So let's say the had a party named ...Bob and a number of 3, EXHIB = Bob3, and our new variable would be named Bob3.

The reason I need Bob3 is because I want to put more information into a specific item that is the unique item of Bob3 which would include the page number of Bob3 and other bits of information that might be added at other points of the document. So I'm wanting this to be a persistent variable that is the value of EXHIB. (Sorry if I am over explaining.)
Reply With Quote