+ Reply to Thread
Results 1 to 9 of 9

Naming and object and writing a macro to put it in a specific cell

  1. #1
    Registered User
    Join Date
    06-16-2009
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2002
    Posts
    5

    Naming and object and writing a macro to put it in a specific cell

    I have several objects I want to name say Tom, **** and Harry, instead of the generic name excel gives (i.e. Object 1, Object 2, Object 3).

    I want to have in a cell the word "tom". Then I want to write a macro that will look at the word in a specific cell ("tom") and grab the object called "tom" and place it in cell A1 of a different sheet.

    Anyone know how to do this?

  2. #2
    Forum Contributor starryknight64's Avatar
    Join Date
    09-27-2006
    Location
    Missouri
    MS-Off Ver
    2003 (Work) & 2007 (Home)
    Posts
    193

    Re: Naming and object and writing a macro to put it in a specific cell

    Do you mean a cell named "tom" or an actual object named "tom" (i.e. used to be named "Button1" but now is "tom").
    starryknight64

  3. #3
    Registered User
    Join Date
    06-16-2009
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2002
    Posts
    5

    Re: Naming and object and writing a macro to put it in a specific cell

    Both kind of:
    I have the word "tom" in a cell, the cell is not named that.

    AND

    The object was called Object 1 when I pasted it into excel and I renamed it "tom"

    Then I have a sheet with a bunch of pictures/objects on it. I want it to be able to grab the picture named "tom" and put it in cell A1 of a different sheet. It is grabbing the "tom" picture based on the fact that I have the word "tom" in a cell.

    I hope I answered your question

  4. #4
    Forum Contributor starryknight64's Avatar
    Join Date
    09-27-2006
    Location
    Missouri
    MS-Off Ver
    2003 (Work) & 2007 (Home)
    Posts
    193

    Cool Re: Naming and object and writing a macro to put it in a specific cell

    Yes, you did.

    And yes, this does seem possible. You should be able to search through all of the objects in a spreadsheet and look for a specific object's name and return the matching object.

    ...like so:

    Please Login or Register  to view this content.
    I hope this helps!

  5. #5
    Registered User
    Join Date
    06-16-2009
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2002
    Posts
    5

    Re: Naming and object and writing a macro to put it in a specific cell

    Sorry, you are on a much higher level than me in VB code. Where in that code would I plug in the following scenario

    Sheet1 Cell A1="tom"
    Sheet2 several objects, one of them named "tom"

    Paste the object that matches the word in Sheet 1,Cell A1 into Sheet 1 Cell A10

    Thanks for your help

  6. #6
    Forum Contributor starryknight64's Avatar
    Join Date
    09-27-2006
    Location
    Missouri
    MS-Off Ver
    2003 (Work) & 2007 (Home)
    Posts
    193

    Re: Naming and object and writing a macro to put it in a specific cell

    Okay, so I had to change findObject a little bit, but here goes:

    Please Login or Register  to view this content.
    I hope this helps!

  7. #7
    Registered User
    Join Date
    06-16-2009
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2002
    Posts
    5

    Re: Naming and object and writing a macro to put it in a specific cell

    Thats is sooooo awesome! thank you for your help, this makes my life so much easier

  8. #8
    Forum Contributor starryknight64's Avatar
    Join Date
    09-27-2006
    Location
    Missouri
    MS-Off Ver
    2003 (Work) & 2007 (Home)
    Posts
    193

    Cool Re: Naming and object and writing a macro to put it in a specific cell

    I'm glad I could help! Can we consider this problem solved?

  9. #9
    Registered User
    Join Date
    06-16-2009
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2002
    Posts
    5

    Re: Naming and object and writing a macro to put it in a specific cell

    Yes, solved!

+ 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