+ Reply to Thread
Results 1 to 17 of 17

Selecting a hyperlink once condition met

  1. #1
    Registered User
    Join Date
    04-19-2017
    Location
    London, England
    MS-Off Ver
    Office 2010
    Posts
    74

    Selecting a hyperlink once condition met

    Hello,

    I have a spreadsheet which is pulling in live data. Once a condition is met and a cell in the sheet returns a 1, I want to select a hyperlink to send users an alert SMS. I was trying to use something like I have put below. It works when I manually step through the formula and force the value in the reference cell to be 1 but I am unable to make this run continuously / monitor in the background. Is something missing or is there an option I need to be using to have excel be constantly monitoring ?
    Please Login or Register  to view this content.
    As a further requirement, ideally I would be able to stop the macro from looping and sending repeated messages on the same item. - Essentially, once a value of 1 has been returned and the hyperlink cell followed, i would want an "override" cell to become active which the user would then clear once they have processed the alert.

    Many thanks
    Last edited by Leith Ross; 04-19-2017 at 08:36 PM. Reason: Added Code Tags

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Selecting a hyperlink once condition met

    Hi millerjj22
    Is only C44 going to be populated with the no 1 and only A44 going to have the hyperlink
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    04-19-2017
    Location
    London, England
    MS-Off Ver
    Office 2010
    Posts
    74

    Re: Selecting a hyperlink once condition met

    Yes..... To be totally honest, I was hoping to apply this to a list of cells (c44:c54) or similar but I thought I would cross one bridge at a time !

    Many thanks

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Selecting a hyperlink once condition met

    Try this

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-19-2017
    Location
    London, England
    MS-Off Ver
    Office 2010
    Posts
    74

    Re: Selecting a hyperlink once condition met

    Ok, thanks - that works on a list now. I still need to manually "play" the macro or step through it, how do I have it monitoring / always running so that as soon as the value in c44 changes to a 1, the macro picks it up and executes the hyperlink using the above code ?

    Thanks a lot

  6. #6
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Selecting a hyperlink once condition met

    Put this code in the sheet module
    Please Login or Register  to view this content.
    Last edited by Sintek; 04-20-2017 at 03:35 AM. Reason: Took out unneccassary If statement

  7. #7
    Registered User
    Join Date
    04-19-2017
    Location
    London, England
    MS-Off Ver
    Office 2010
    Posts
    74

    Re: Selecting a hyperlink once condition met

    Hello,

    Sorry, perhaps I misunderstood but the sheet is still not "monitoring". As you can see from attached, if anything in c44:c54 is changed, a website is not launched.

    Many thanks
    Attached Files Attached Files

  8. #8
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Selecting a hyperlink once condition met

    Here you go:
    Code to be placed in the sheet object "sheet1"
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-19-2017
    Location
    London, England
    MS-Off Ver
    Office 2010
    Posts
    74

    Re: Selecting a hyperlink once condition met

    Hello again,

    Thank you very much sintek. That works in isolation. When I try to copy and paste this code into a new module in a larger datasheet, I am back to nothing happening. Is there any setting that I need to consider to allow this ongoing monitoring or do I need to specify the sheet name ("summary") in the vba code ?

    Much appreciated, it was great to have the websites launch immediately when I entered the 1!

  10. #10
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Selecting a hyperlink once condition met

    did you put the code under the correct worksheet?

    Please Login or Register  to view this content.
    did you expand this to cover your expected area?
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  11. #11
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Selecting a hyperlink once condition met

    You need to put the code within the sheet object....So if the worksheet which contains the website links is called Sheets("Summary")
    The code goes into the Sheets("Summary") object..right click on sheet, click view code and paste code in
    Attached Images Attached Images

  12. #12
    Registered User
    Join Date
    04-19-2017
    Location
    London, England
    MS-Off Ver
    Office 2010
    Posts
    74

    Re: Selecting a hyperlink once condition met

    Yes I did. In a fresh module in the right worksheet!

    I was hoping to just drop this extra piece of code into the large workbook but something is causing it not to work.

    Thanks

  13. #13
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Selecting a hyperlink once condition met

    Nope not a module.......in the worksheet itself

  14. #14
    Registered User
    Join Date
    04-19-2017
    Location
    London, England
    MS-Off Ver
    Office 2010
    Posts
    74

    Re: Selecting a hyperlink once condition met

    AHA !

    Sorry, user error on my part.... that is awesome, thanks.

    If I may push my luck a little, is there an easy way to achieve the second part of my query? - Every time the sheet gets refreshed with data and then recalculates, the code loops and opens the website again.

    "As a further requirement, ideally I would be able to stop the macro from looping and sending repeated messages on the same item. - Essentially, once a value of 1 has been returned and the hyperlink cell followed, i would want an "override" cell to become active which the user would then clear once they have processed the alert."

    Thanks so much

  15. #15
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Selecting a hyperlink once condition met

    Please Login or Register  to view this content.
    Or are you wanting a message to come up that says link alert sent and then have another cell's value filled with a flag od sorts...Don't know how your info gets populated in Column C
    Last edited by Sintek; 04-20-2017 at 04:36 AM.

  16. #16
    Registered User
    Join Date
    04-19-2017
    Location
    London, England
    MS-Off Ver
    Office 2010
    Posts
    74

    Re: Selecting a hyperlink once condition met

    Ah, ok - as simple as that ! - I was thinking of much more convoluted ways of achieving that.... I can just add a further macro which replaces the formula in the cell when the user has actioned the alert.

    Many thanks !

  17. #17
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Selecting a hyperlink once condition met

    Pleasure

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 05-22-2014, 05:09 AM
  2. [SOLVED] Selecting a table based on drop down list condition
    By bos1234 in forum Excel General
    Replies: 23
    Last Post: 02-21-2014, 04:18 PM
  3. [SOLVED] hyperlink 2 sheets by condition
    By nicu in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 12-19-2013, 06:24 AM
  4. [SOLVED] Hyperlink 2 sheets by condition
    By nicu in forum Excel General
    Replies: 1
    Last Post: 12-19-2013, 05:01 AM
  5. i need to hyperlink cells with condition
    By dadosado in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-15-2013, 03:10 AM
  6. selecting specific rows based on condition
    By darkhorse4321 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-03-2010, 02:02 AM
  7. Selecting Rows Based on a Column Condition
    By NateNeedsVBAHelp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-05-2009, 01:02 PM

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