C
Caleb Runnels
I am wanting to use a variable in place of a control name to do a loop.
Here's the basics. The controls, ETYPE, EENTRY, FREQ, and ETIME are all on
Userform1. They are all labeled 1-48. (ETYPE1, ETYPE2, ETYPE3, etc.) I want
the ("EntryLine") in the code below to be the value of the variable
EntryLine. I keep getting a compile error of "Method or data member not
found." Any help with how to get this to work will be greatly appreciated.
Thanks!
CODE:
Dim EntryLine as Integer
EntryLine = 1
Public Sub CommandButton1_Click()
Do While EntryLine <= 48
Selection.Font.Bold = wdToggle
Selection.Font.Underline = wdUnderlineSingle
Selection.TypeText Text:=UserForm1.ETYPE("EntryLine").Value
Selection.Font.Bold = wdToggle
Selection.Font.Underline = wdUnderlineNone
Selection.TypeText Text:=UserForm1.EENTRY("EntryLine").Value
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:=UserForm1.FREQ("EntryLine").Value
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:=UserForm1.ETIME("EntryLine").Value + "z"
Selection.MoveRight Unit:=wdCell
EntryLine = EntryLine + 1
Loop
End Sub
Here's the basics. The controls, ETYPE, EENTRY, FREQ, and ETIME are all on
Userform1. They are all labeled 1-48. (ETYPE1, ETYPE2, ETYPE3, etc.) I want
the ("EntryLine") in the code below to be the value of the variable
EntryLine. I keep getting a compile error of "Method or data member not
found." Any help with how to get this to work will be greatly appreciated.
Thanks!
CODE:
Dim EntryLine as Integer
EntryLine = 1
Public Sub CommandButton1_Click()
Do While EntryLine <= 48
Selection.Font.Bold = wdToggle
Selection.Font.Underline = wdUnderlineSingle
Selection.TypeText Text:=UserForm1.ETYPE("EntryLine").Value
Selection.Font.Bold = wdToggle
Selection.Font.Underline = wdUnderlineNone
Selection.TypeText Text:=UserForm1.EENTRY("EntryLine").Value
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:=UserForm1.FREQ("EntryLine").Value
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:=UserForm1.ETIME("EntryLine").Value + "z"
Selection.MoveRight Unit:=wdCell
EntryLine = EntryLine + 1
Loop
End Sub