+ Reply to Thread
Results 1 to 11 of 11

Best way to program tooltips in VBA

  1. #1
    Registered User
    Join Date
    08-02-2018
    Location
    Belgium
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5

    Best way to program tooltips in VBA

    Hi,
    I wrote a VBA macro that reads machine downtimes from a database and visualises this information in a calendar.
    Each cell in the excel calendar represents a 2 hour shift. When a cel is clicked a tooltip appears with detailed information.
    This works fine but performance is bad. Before adding the 'selection.Validation' command the performance was good.
    So the problem is this statement.
    Are there better ways to do this ?

    Code : coloring each cell and defining the tooltip :
    Please Login or Register  to view this content.
    Last edited by dominicb; 08-02-2018 at 05:03 AM. Reason: Code tags added

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,333

    Re: Best way to program tooltips in VBA

    Deleted. Double post.
    Last edited by bakerman2; 08-02-2018 at 04:26 AM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,333

    Re: Best way to program tooltips in VBA

    @ MarkSt

    Welcome to the forum, please use Code Tags when posting code. (Forum Rule#3)

    Why not add the information as a comment ? (Opmerking)

    That way you only need to hoover over a cell to get the information.

  4. #4
    Registered User
    Join Date
    08-02-2018
    Location
    Belgium
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5

    Re: Best way to program tooltips in VBA

    Can I insert a comment using a range ? I tried it at one point but did not succeed.
    Typically when you insert a comment you see a small red indication in the cell.
    Can you change the color red indicator ?
    Alvast bedankt voor de hulp !

  5. #5
    Registered User
    Join Date
    08-02-2018
    Location
    Belgium
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5

    Re: Best way to program tooltips in VBA

    I tried the following ==>

    Please Login or Register  to view this content.
    But without success. My problem is that I want to use row and columnnumber and not for example 'A5'.
    Last edited by MarkSt; 08-02-2018 at 04:50 AM.

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,333

    Re: Best way to program tooltips in VBA

    Try this.
    Please Login or Register  to view this content.
    Last edited by bakerman2; 08-02-2018 at 05:27 AM.

  7. #7
    Registered User
    Join Date
    08-02-2018
    Location
    Belgium
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5

    Re: Best way to program tooltips in VBA

    Your suggestion works but notice that each cell with a comment has a little red triangle in the upper right corner. Standard excel behaviour for comments.
    Do you know If I can make this red triangle disappear ? Maybe by changing the color ? Set the color equal to the color of the cell ?

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,333

    Re: Best way to program tooltips in VBA

    From Debra Dalgleish.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    08-02-2018
    Location
    Belgium
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5

    Re: Best way to program tooltips in VBA

    I tried it and the comment indicator was 'removed'. The calendar template has many different cell borders. After removing the indicator the cells looks different from the original ones. When selecting a cell a bigger object is selected. Also the size of the excel file is much larger and processing time is also much longer.

    If I compare this solution with a previous version were I used data validation I prefer the last one. Simpler but also slower (bit too slow).
    Thanks for sharing your solution.

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,333

    Re: Best way to program tooltips in VBA

    You wanted the red triangles gone so ....

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  11. #11
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,008

    Re: Best way to program tooltips in VBA

    Depending where the detailed information was coming from ("scomment" in the original post suggests that it's retreived from somewhere) you could use a textbox.
    Being a textbox you can have scrollbars so wouldn't need to worry about sizing or comments becoming distanced from their cells.

    Please Login or Register  to view this content.
    Last edited by ByteMarks; 08-03-2018 at 04:06 AM.

+ 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. Custom Chart Tooltips VBA
    By lyla22 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-08-2014, 08:42 AM
  2. [SOLVED] Tooltips for cells
    By hhost in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2013, 08:15 AM
  3. VBA debug tooltips missing
    By paynterf in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-24-2011, 09:23 PM
  4. Excel 2007 : PivotTable Contextual Tooltips
    By DVTiger in forum Excel General
    Replies: 0
    Last Post: 12-10-2010, 02:08 PM
  5. Tooltips or Comment looking up a reference
    By JonBoy in forum Excel General
    Replies: 4
    Last Post: 05-20-2006, 09:20 PM
  6. ToolTips or ScreenTips
    By Stuart Grant in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 09-30-2005, 11:40 AM
  7. Adding ToolTips to buttons
    By Carlos Lozano in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2005, 11:06 PM

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