G
Gojavid
Good morning all,
I have some code that uses a variable in a object name.
Actually, it doesn't use it yet, but I'd like it to. I have the
following code that I've tried in several different variations, but I
haven't been able to get it to work.
Code:
If Worksheets("patient data").Range("C20") <> "" Then
pd = 14
ElseIf Worksheets("patient data").Range("C19") <> "" Then
pd = 13
End if
tx_box = "Textbox" & pd
For ot = 1 To pd
With tx_box
.Enabled = True
.Visible = True
End With
Next ot
Any ideas?
I have some code that uses a variable in a object name.
Actually, it doesn't use it yet, but I'd like it to. I have the
following code that I've tried in several different variations, but I
haven't been able to get it to work.
Code:
If Worksheets("patient data").Range("C20") <> "" Then
pd = 14
ElseIf Worksheets("patient data").Range("C19") <> "" Then
pd = 13
End if
tx_box = "Textbox" & pd
For ot = 1 To pd
With tx_box
.Enabled = True
.Visible = True
End With
Next ot
Any ideas?