Home > other >  Formatting Inputs with Rules in VBA
Formatting Inputs with Rules in VBA

Time:06-14

not sure how do phrase this question but I really dont understand it.

I want to achieve the following:

  1. TextBox = TextVorname
  2. TextBox = TextNachname

For Example I put in the 1. Textbox "Markus" and put in the 2. Textbox "Neumann"

I want it to display in the Bookmark "Ma.Ne_2022"

I have following Code:

Private Sub OptionButton1_Click()

Dim VornameStr As String

VornameStr = Me.TextVorname.Caption

Dim NachnameStr As String
NachnameStr = Me.TextNachname.Caption

MyStrVorname = Left(VornameStr, 2)

MyStrNachname = Left(NachnameStr, 2)

MyStrFullname = MyStrVorname & "." & MyStrNachname & "_2022"


Call UpdateBookmark("test1", Me.MyStrFullname.Caption)

End Sub

CodePudding user response:

Your question is a little bit vague.. Maybe this is what you're after?

Dim MyVornameStr As String
Dim MyNachnameStr As String
Dim MyStrFullname As String

MyStrVorname = Left(Me.TextVorName.Text, 2)
MyStrNachname = Left(Me.TextNachName.Text, 2)

MyStrFullname = MyStrVorname & "." & MyStrNachname & "_2022"

Call UpdateBookmark("test1", MyStrFullname)
  • Related