brad71
02-02-2019, 12:36 PM
I am working on expanding a project where someone has the ability to select something from a Combo Box which will then call a sub to insert various data into the document. Some of the information in the sub I would like to be able to display allowing the user to click on a Button.
Private Sub BtnClick()
Dim TextFromButtonClick as String
If Combobox.Value = "Data 1" Then
'' I would like to set TextFromButtonClick to equal TextToDisplay from Data1
Else If Combobox.Value = "Data 2" Then
'' I would like to set TextFromButtonClick to equal TextToDisplay from Data2
End If
msgbox TextFromButtonClick
End Sub
Private Sub Data1()
Dim TextToDisplay as String
' Other Various Information to insert
TextToDisplay = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
End Sub
Private Sub Data2()
Dim TextToDisplay as String
' Other Various Information to insert
TextToDisplay = "Curabitur eu est libero."
End Sub
Any help would be appreciated.
Private Sub BtnClick()
Dim TextFromButtonClick as String
If Combobox.Value = "Data 1" Then
'' I would like to set TextFromButtonClick to equal TextToDisplay from Data1
Else If Combobox.Value = "Data 2" Then
'' I would like to set TextFromButtonClick to equal TextToDisplay from Data2
End If
msgbox TextFromButtonClick
End Sub
Private Sub Data1()
Dim TextToDisplay as String
' Other Various Information to insert
TextToDisplay = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
End Sub
Private Sub Data2()
Dim TextToDisplay as String
' Other Various Information to insert
TextToDisplay = "Curabitur eu est libero."
End Sub
Any help would be appreciated.