help needed trying to find autoshape/shape name

  • Thread starter Thread starter funkymonkUK
  • Start date Start date
F

funkymonkUK

hi i got a sheet which I copy and insert it at the end of the workboo
problem is that I have a rectangle which I would like text to be insid
however it changes names as soon as I copy it is there a way I could us
like a variable to do what I want with the only shape on my sheet.


Code
-------------------
Sub Macro6()

ActiveSheet.Shapes("Rectangle 1627").Select
Selection.Characters.Text = "hello world. Its" & Now()
End Sub
 
You say you only have one shape, but you have already described having a
command button on the sheet, which is a shape as well. So I assume you know
where the shape is located:

for each shp in ActiveWorksheet.Shapes
if shp.TopLeftCell.Address = "$B$9" then
shp.TextFrame.Characters.Text = "hello world. Its" & Now()
end if
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top