+ Reply to Thread
Results 1 to 13 of 13

Assign a value to an image

  1. #1
    Registered User
    Join Date
    04-15-2010
    Location
    Chicago
    MS-Off Ver
    Office 365
    Posts
    17

    Assign a value to an image

    I'm relatively new to excel programming.

    What I want to do:

    Assign a value to an image that will populate a value within the same row.

    http://farm5.static.flickr.com/4046/...9804577d59.jpg

    There's a link to a brief image of a part of my file.

    As you can see I have 5 columns (Paid, Trade, Customer Extra, Not Paid, Self Promotion). Right now I am manually entering in "1's" in each of those columns to correspond to the image shown on the left.

    Is there a way to assign a macro to each image so that it will manually populate the proper column?
    Last edited by Dissonant; 04-19-2010 at 10:41 AM. Reason: Solved

  2. #2
    Registered User
    Join Date
    04-15-2010
    Location
    Chicago
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Assign a value to an image

    http://www.excelforum.com/excel-prog...n-a-macro.html

    I noticed this thread, that has similar applications. After reading that, i'm thinking the easiest solution could be to create a macro that would populate the cell that the image is pasted into with the image's alt text. Fom there it's an easy matter of populating the proper column with "1's" Although I'm not really sure where to start with something like that.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Assign a value to an image

    Hello Dissonant,

    Your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!

    Cross posted here: http://www.mrexcel.com/forum/showthread.php?t=461839
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    04-15-2010
    Location
    Chicago
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Assign a value to an image

    Sorry, I just saw the Forum Rules post at the top of this forum that only had 3 specifications. I thought Double posting only applied to posting multiple threads on this forum.

    I hadn't gotten any nibbles yet so I figured I'd try my luck on another forum as well.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Assign a value to an image

    Hello Dissonant,

    No problem. Do want the cell to be filled in when the user clicks the image?

  6. #6
    Registered User
    Join Date
    04-15-2010
    Location
    Chicago
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Assign a value to an image

    Not when a user clicks, I just want the cell to be automatically populated, or if nothing else be populated when I run the macro.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Assign a value to an image

    Hello Dissonant,

    It would be easier to supply you with the needed code if your workbook were available. Can you post your workbook?

  8. #8
    Registered User
    Join Date
    04-15-2010
    Location
    Chicago
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Assign a value to an image

    http://www.mixedmediaoutdoor.com/Testing.zip

    There's a link. Upload feature was timing out for me.

    It's columns E-I that I'd like to automate, so each time I move the pictures I don't have to manually assign values under paid, trade, extra, not paid and self promo.

  9. #9
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Assign a value to an image

    Hello Dissonant,

    I got the file and open it. I don't understand how the columns would be populated using the pictures. Can you explain in more details what you want to happen?

  10. #10
    Registered User
    Join Date
    04-15-2010
    Location
    Chicago
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Assign a value to an image

    Column B, the column of pictures is pasted from another sheet. When I paste the pictures into that sheet, I would like excel to automatically register what kind of advertising it is(paid, trade, extra, not paid, promo). I know I'll have to assign that value to the picture, whether it's in the alt text or elsewhere, but I would like to only have to do that once as opposed to everytime things move.

  11. #11
    Registered User
    Join Date
    04-15-2010
    Location
    Chicago
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Assign a value to an image

    Really the bottom line is, I'm trying to find some kind of function or macro that will return the alt text of an image in the same row. Unless the wizards here can think of an easier way.

  12. #12
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Assign a value to an image

    Hello Dissonant,

    I have created 2 macros for you. One that assigns the ad type based on the number one in column "E:I" and a UDF to return the ad type to a cell using the picture's name. I already ran the SetAdType macro to assign the ad type to alternative text and added the UDF in column "D" so you can see the ad type.

    Like you, I can't upload anything to the Forum. If you send your me email address, I'll send the workbook to you. My email is [email protected]

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    04-15-2010
    Location
    Chicago
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Assign a value to an image

    Please Login or Register  to view this content.
    Here is the final solution from Leith that picks up a picture in the same row and returns it's Alt Text.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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