dj44
04-30-2017, 08:15 AM
Hi folks,
Good Sunday
:)
How do i get my macro to accept the userform text box value that I enter.
I know how to use a simple input box but the input box is very small and I can't often read the value in that case I wanted to use a userform textbox but oh dear unfortunately I've got stuck and I'm not sure how to make this textbox accept my macro submit click value if that makes any sense
Sub ShowUserformTextBox()
UF1.show
'MsgBox "hello" & UF1.TextBox1.Value
End Sub
Sub ExampleTextBox_Input()
Dim oText As String
UF1.show
' -I know how to use an input box but i would like to use a userform bix as its bigger
'oText = InputBox("Duplicate Range - how Many Times would you like to ?")
'If Len(oText) = 0 Then
'Exit Sub
'End If
'===== HOW DO I get the value from the userform text box?
oText = UF1.TextBox1.Value
Dim i As Integer
Selection.WholeStory
Selection.Copy
For i = 1 To oText
Selection.PasteAndFormat (wdFormatOriginalFormatting)
Next
End Sub
I am trying to pass a variable to my main macro and I have used an example
please do have a look and see how I can achieve this task thank you so much
Good Sunday
:)
How do i get my macro to accept the userform text box value that I enter.
I know how to use a simple input box but the input box is very small and I can't often read the value in that case I wanted to use a userform textbox but oh dear unfortunately I've got stuck and I'm not sure how to make this textbox accept my macro submit click value if that makes any sense
Sub ShowUserformTextBox()
UF1.show
'MsgBox "hello" & UF1.TextBox1.Value
End Sub
Sub ExampleTextBox_Input()
Dim oText As String
UF1.show
' -I know how to use an input box but i would like to use a userform bix as its bigger
'oText = InputBox("Duplicate Range - how Many Times would you like to ?")
'If Len(oText) = 0 Then
'Exit Sub
'End If
'===== HOW DO I get the value from the userform text box?
oText = UF1.TextBox1.Value
Dim i As Integer
Selection.WholeStory
Selection.Copy
For i = 1 To oText
Selection.PasteAndFormat (wdFormatOriginalFormatting)
Next
End Sub
I am trying to pass a variable to my main macro and I have used an example
please do have a look and see how I can achieve this task thank you so much