Change a String into a label

chris.coryell

New Member
Joined
Jul 27, 2008
Messages
3
Hello.

I'm working with a map that has about 40 labels. I'm trying to write a small module that will step through the labels and based on values in a different sheet change the label caption to a name that makes sense on the map.

The way I'm trying to do this is by using a for loop and using an integer to change between the labels like this:

For i = 1 to 40 step 1
x = "Label" + Cstr(i)
ActiveSheet.Shapes(x).caption = "My_text"
Next i

However, I keep getting the "doesn't support this property" error.

Any thoughts?

Thanks in advance.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hi Chris
Welcome to the board

Is it a Label from the Forms toolbar of from the Control (ActiveX) toolbar?
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,876
Members
452,363
Latest member
merico17

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