What is the mistake in this cod?

PARSA

New Member
Joined
Jan 30, 2014
Messages
44
HELLO,
THIS COD IS NOT WORK! WHAT?
Code:
Dim C As Integer
For C = 1 To 2
LabelC.Enabled = True
Next
I HAVE 2 LABEL THAT HAVE THIS PROPERTIES: (Enabled = False)
AND I WANT TO CHANGE THIS PROPERTIES TO "TRUE" WITH THIS COD, BUT THIS COD NOT WORK!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Try this:
Code:
Dim C As Integer
For C = 1 To 2
LabelC.Enabled = True
Next [B][SIZE=2][COLOR=#b22222]C[/COLOR][/SIZE][/B]
 
Upvote 0
HELLO,
THIS COD IS NOT WORK! WHAT?
Code:
Dim C As Integer
For C = 1 To 2
LabelC.Enabled = True
Next
I HAVE 2 LABEL THAT HAVE THIS PROPERTIES: (Enabled = False)
AND I WANT TO CHANGE THIS PROPERTIES TO "TRUE" WITH THIS COD, BUT THIS COD NOT WORK!
1) Where is the label located at... on a worksheet or in a UseForm?

2) If on a worksheet, then what kind of label is it... a Forms label or an ActiveX label?
 
Upvote 0
Try your code this way...
Code:
Dim C As Integer
For C = 1 To 2
  Me.Controls("Label" & C).Enabled = True
Next
THANKS
51.gif
 
Upvote 0

Forum statistics

Threads
1,223,566
Messages
6,173,103
Members
452,501
Latest member
musallam

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