• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • SALE 20% Off All Courses
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member
  • Login

Calling a Function using Hyperlink|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Calling a Function using Hyperlink|VBA & Macros|Excel Forum|My Online Training Hub
                    BLACK FRIDAY SALE 20% OFF ALL COURSES
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosCalling a Function using Hyperlink
sp_PrintTopic sp_TopicIcon
Calling a Function using Hyperlink
Avatar
Peter Morris
Member
Members
Level 0
Forum Posts: 16
Member Since:
July 20, 2019
sp_UserOfflineSmall Offline
1
May 7, 2020 - 11:59 pm
sp_Permalink sp_Print

Hi,

I recall Mynda using a function as the first parameter of a Hyperlink function to control a dashboard.

However, whenever I now try to replicate this I find the hyperlink shows ‘#value’.  I’ve broken down what I recall of the method as far as I can and am using the functions and code shown below as tests.  The code works and updates cell E1 to either “Updated” or “Cleared” as appropriate (I use the ‘cellupdated’ variable simply to stop the dostuff() function being called multiple times), but nothing I do will show the ‘friendly name’.  I also tried to use the application.ontime function to clear the cell, but that never runs either.

I suspect its a limitation of the using Hyperlink this way, but I’d be grateful for any advice or direction to solve the problem.

The hyperlinks and the associated code are as follows:

                In C4: =hyperling(dostuff(), “a Function”)

                In C6: =hyperlink(doclear(),”doclear”)

 

[code]

Dim cellupdated As Boolean

 

Function dostuff()

If Not cellupdated Then

    cellupdated = True

    Range("E1") = "Updated"

End IF

End Function

 

 

Function doclear()

    cellupdated = False

    Range("E1") = "cleared"

End Function

[/code]

sp_AnswersTopicSeeAnswer See Answer
Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1563
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
2
May 8, 2020 - 2:11 pm
sp_Permalink sp_Print sp_EditHistory

Hi Peter,

You just need to wrap the HYPERLINKS in IFERROR because mousing over the link will generate an error.

=IFERROR(HYPERLINK(dostuff(), "DoStuff"),"DoStuff")

See attached.

regards

Phil

sp_AnswersTopicAnswer
Answers Post
Avatar
Peter Morris
Member
Members
Level 0
Forum Posts: 16
Member Since:
July 20, 2019
sp_UserOfflineSmall Offline
3
May 22, 2020 - 11:13 pm
sp_Permalink sp_Print

Thanks Phil, much appreciated - I wish I'd realised it was that simple.  I'm learning.  Many thanks.

Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1563
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
4
May 23, 2020 - 9:42 am
sp_Permalink sp_Print

No worries 🙂

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Wang, Melanie Toye, RICCES CALINAO
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Catalin Bombea: 1864
SunnyKow: 1432
Anders Sehlstedt: 886
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 241
Hans Hallebeek: 225
Jessica Stewart: 219
A.Maurizio: 213
Newest Members:
Robert Corbyn
Tamara Nelson
Phil Collins
Robert Moran
Mark Niemiec
Michael Groh
Paula Holbrook
Russ Cockings
Huub Poppelaars
Pieter Brandsen
Forum Stats:
Groups: 3
Forums: 24
Topics: 6639
Posts: 29131

 

Member Stats:
Guest Posters: 49
Members: 33081
Moderators: 2
Admins: 3
Administrators: Mynda Treacy, Philip Treacy, Jessica
Moderators: Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel Office Scripts
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook

Sign up to our newsletter and join over 400,000
others who learn Excel and Power BI with us.

 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate
  • Sponsor Our Newsletter

Support

  • Contact
  • Forum
  • Helpdesk – For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.