# Image mapping in excel



## martinbv (Aug 9, 2010)

I have a database of physical information and photographs relating to 100 footpaths and I would like users to be able to click on a path on a map and go to the relevant information.

Is that possible in Excel??


----------



## majicincells (Jun 10, 2011)

Hi Martin,

Hope you are doing well.

Yes, it is absolutely possible to map images in excel. It would have been of much help, if you could have attached a sample file of yours to understand the query posted by you.

If the images you have are static, and all you want to do is for a user to click and go to a different address in the same workbook, or a different workbook, where the information relevant to a specific image is stored, then all you have to do is to create a *"Hyperlink"* in the map/image and link it with the page or address you want to go to after the map/image is clicked.

I have created a workbook where I have used country maps of 133 countries and I call them dynamically as soon as the user clicks the drop down and chooses a country name. I have attached a snapshot of that workbook for you to take a look at, in case you have a similar requirement.

Let me know if the hyperlink solution works.

:wave:

Best regards,
Niladri Dey


----------



## martinbv (Aug 9, 2010)

Niladri

Thanks for your reply.

I try to keep postings concise to save people's time.

I realise that one can create a hyperlink for the whole image; I have a map showing say 10 paths and would like a hyperlink for each individual path, that is 10 different ones from the same overall image. The type of thing done all the time on say Google maps.

Regards
Brian


----------



## majicincells (Jun 10, 2011)

Hi Brian,


Thank you for the clarification.


Yes, you are absolutely right, Excel will treat one image as a single object hence you will never be able to Hyperlink the same image with different cell addresses. But there is always a way around for any problem.


Follow these simple steps to get your desired result: -
Since Excel will treat an image as a whole, you will not be able to build 10 different relationships for the same object, therefore *"Cut"* the entire image into 10 different parts each having a sepearte path.
Once you have cut the entire image into 10 different parts, define a *"Name*"for every individual part. I have attached a screenshot which will help you to understand how you can define a name for every individual part.
After you have defined names for every individual parts, you can either *"Hyperlink"* every individual part to a specific cell having relevant information for that part or you can assign different codes which will pop a msgbox with the relevant information for that individual part. I have attached a zipped folder with an excel sheet where I have 10 random images all having an individual name and 1 group of all the 10 images as one image. Enable the macro and see how it works.
If you want to assign macro to every individual part where a msgbox will pop up after a User clicks on a certain portion of the image, then, open the zipped file I have attached, enable the macros and press *"Alt+F11"* to view the codes.
Once you have assigned a Hyperlink or assigned the individual codes to all the 10 parts of the image, then select all the 10 images by holding the *"Ctrl" *button and define a *"Name" *which will represent the 10 different parts as 1 image.
Please remember to assign either the 10 different codes, similar to the one I have written in the attached excel sheet or assign 10 different hyperlinks to every individual part before defining a single *"Name"* which will refer to the group of 10 images.
Until and unless you define every element in your image as an individual entity or object, Excel will not be able to refer to 10 different addresses for a single image and you will see that after you have defined a single name for the group of 10 images, it will look like a single image vs. 10 different images. Please refer to the screenshot and the excel sheet attached with this post for clarifications.

Hope this solution works out for you.

:wave:

Best regards,
Niladri Dey


----------



## martinbv (Aug 9, 2010)

Niladri

Thanks that is most helpful and should enable me to achieve my objective.

The trick I had missed was "cutting up" the image.

Thanks for your help.

Regards
Brian


----------



## majicincells (Jun 10, 2011)

Hi Brian,

Great to know that, Enjoy Excelling!!!

Regards,
Niladri Dey


----------

