VBA Rename multiple shapes with multiple cell values

decadence

Well-known Member
Joined
Oct 9, 2015
Messages
525
Office Version
  1. 365
  2. 2016
  3. 2013
  4. 2010
  5. 2007
Platform
  1. Windows
Hi, Is it possible to rename the active sheet shapes with cell values, there will only ever be 15 shapes in column C and 15 cell values to use as a name in Column B

cells B2,13,24,35,46,57,68,79,90,101,112,123,134,145,156 - Each cell has a different name and will always be a number.

Both Column B and C have merged cells with 7 cells used to merge with in each group of cells
example:
B2-B8 (B2 contains the name) and C2-C8 will have a shape in that area.
B13-B19 (B13 contains the name) and C13-C19 will have a shape in that area.
B24-B30 (B24 contains the name) and C24-C30 will have a shape in that area.
So Rename C2-C8 Shape with B2, Rename C13-C19 Shape with B13 and Rename C24-C30 with B24

Hope this makes sense, Can someone help with this please in that area. e.g. cell 13-19, 24-30
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Perhaps this:-
Code:
[COLOR="Navy"]Sub[/COLOR] MG18Feb39
[COLOR="Navy"]Dim[/COLOR] Sh [COLOR="Navy"]As[/COLOR] Shape
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Sh [COLOR="Navy"]In[/COLOR] ActiveSheet.Shapes
 [COLOR="Navy"]If[/COLOR] Sh.TopLeftCell.Column = 3 [COLOR="Navy"]Then[/COLOR]
    Sh.Name = Sh.TopLeftCell.Offset(, -1).MergeArea(1).Value
  [COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]Next[/COLOR] Sh
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0
Hi MickG, This is perfect, Thank you for your help
 
Upvote 0

Forum statistics

Threads
1,223,640
Messages
6,173,503
Members
452,517
Latest member
SoerenB

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