calling text boxes/frames in procedures

VBAmalta89

Board Regular
Joined
Mar 25, 2011
Messages
116
i hve a text box within a frame which i would like to call in a procedure.

How do i reference it?

Also, what if the text box name was variable, i.e. they're called text1 to text8 and i need to call them in a loop?
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi VBAmalta89,

I'm not sure whether you are referring to a TextFrame object of a Shape object or a Frame control that groups controls on a userform. Can you clarify?

Damon
 
Upvote 0
thanks for your reply but I have managed to solve the problem using teh code below:

Code:
Private Sub done_Click()

Dim i As Long

For i = 1 To 8 Step 1
  If Me.Controls("Frame" & i).Object.Enabled = True Then
    If Len(Me.Controls("AZone" & i).Value) = 0 Then
       MsgBox "Please enter AZone" & i & " value to proceed!"
       Exit Sub
    End If
  End If
Next i

MsgBox "Success!"

End Sub
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,278
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top