+ Reply to Thread
Results 1 to 2 of 2

help needed trying to find autoshape/shape name

Hybrid View

  1. #1
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500

    help needed trying to find autoshape/shape name

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

    Sub Macro6()
    
        ActiveSheet.Shapes("Rectangle 1627").Select
        Selection.Characters.Text = "hello world. Its" & Now()
        End Sub

  2. #2
    Tom Ogilvy
    Guest

    RE: help needed trying to find autoshape/shape name

    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

    --
    Regards,
    Tom Ogilvy


    "funkymonkUK" wrote:

    >
    > hi i got a sheet which I copy and insert it at the end of the workbook
    > problem is that I have a rectangle which I would like text to be inside
    > however it changes names as soon as I copy it is there a way I could use
    > 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
    >
    > --------------------
    >
    >
    > --
    > funkymonkUK
    > ------------------------------------------------------------------------
    > funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135
    > View this thread: http://www.excelforum.com/showthread...hreadid=544699
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1