+ Reply to Thread
Results 1 to 10 of 10

launching same hyperlink in dynamic cells

  1. #1
    Registered User
    Join Date
    04-22-2009
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2007
    Posts
    32

    Thumbs up launching same hyperlink in dynamic cells

    I am designing a spreadsheet for engineering service faults. One of the requirements is to launch Google Maps to see where the customer is situated. I am able to write a formula eg =HYPERLINK("http://maps.google.com/maps?q="&G2&"+&iwloc=A&hl=en"), in a cell that looks up the postcode (in my attached example, cell s G2 and G3) and then launch the map by clicking the adjacent cells in H2 and H3. What I would like to do is, do away with the unsightly looking Hypertext in the cell and write code to do the following:- if a cell in column G is blank then the adjacent cell in H is also blank. If a post code is in a cell in G then “Map” appears in the cell next to it in H. Then when the user wants to look at where the customer is clicks on “Map” and Google Map is launched. The same hyperlink is used for all instances and the column will be the same but rows will be dynamic.
    Many thanks in anticipation.
    Attached Files Attached Files
    Last edited by Fairport; 05-20-2009 at 11:30 AM. Reason: Doh!! forgot to attach file

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,445

    Re: launching same hyperlink in dynamic cells

    Hi,

    In H2 and copied down:

    =IF(ISBLANK(G2),"",HYPERLINK("http://maps.google.com/maps?q="&G2&"+&iwloc=A&hl=en","MAP"))
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: launching same hyperlink in dynamic cells

    Formula in H2 copied down.


    =IF(G2="","",HYPERLINK("http://maps.google.com/maps?q="&G2&"+&iwloc=A&hl=en","Map"))
    Cheers
    Andy
    www.andypope.info

  4. #4
    Registered User
    Join Date
    04-22-2009
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: launching same hyperlink in dynamic cells

    Ddiolch filiwn. Although that doesnt translate directy to "Thanks a million" in Welsh the sentiments applies to both, thanks guys. The cell with the hypertext is now blank, a) it doesn't invoke the link and b) "Map" doesn't appear in the cell.
    I will persist.
    Would like to know how to do it in VBA if possible please?
    Last edited by Fairport; 05-15-2009 at 09:42 AM. Reason: add comment

  5. #5
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,445

    Re: launching same hyperlink in dynamic cells

    Croeso - mae'n bleser!

  6. #6
    Registered User
    Join Date
    04-22-2009
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2007
    Posts
    32

    Thumbs up Re: launching same hyperlink in dynamic cells

    For those of you who require a tool to translate Welsh (or any other language) go to:-
    HTML Code: 

    Sorry guys both your formulas worked, in my excitement to get the thing working I forgot to change the cell references in the formulas in the actual spreadsheet! Its been a long hard week!!!
    Although this solution will do the job adequately if anyone comes up with a VB solution I would still be interested, (learning curve and all that). Thanks again.
    pawb ca da benwythnos

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: launching same hyperlink in dynamic cells

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    04-22-2009
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: launching same hyperlink in dynamic cells

    This looks interesting
    Quote Originally Posted by Andy Pope View Post
    Please Login or Register  to view this content.
    Where do I paste the code? I've tried copying it to 'sheet1(Data)' in the original example I attached but nothing appears to be working. My lack of knowledge playing a big part again!!

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: launching same hyperlink in dynamic cells

    You could put it in a standard code module.
    ALT+F11 (VBE)
    Insert > Module

    You would need to place it in subroutine

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    04-22-2009
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2007
    Posts
    32

    Thumbs up Re: launching same hyperlink in dynamic cells

    Thank you. With a bit of tweeking here and there it works fine.

+ 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