+ Reply to Thread
Results 1 to 2 of 2

Macro for tooltip

  1. #1
    Registered User
    Join Date
    02-20-2022
    Location
    US
    MS-Off Ver
    2019
    Posts
    1

    Macro for tooltip

    I have a friend that gave me some pseudo code so I could start figuring out how to code. Its like driving a car for the first time and need help organizing.

    Basically, I need a macro that will read the first row cell texts and return a specific tooltip. For example, the macro will read "AA" and return "tooltip for AA" text. I need to run the macro to read the values because the placement of what is being read isn't always in the same column.

    if anyone has a macro version using comment feature, that works, too. I think I saw a video somewhere that showed how to make your comment box pretty and h overable.

    Here is what I have so far:

    ‘Select the range of headers, either automatically or manually before triggering the macro headerRange=Range([first cell],[last cell)
    ‘or
    headerRange=Selection
    ‘iterate through each cell of the range
    For Each headerCell in headerRange
    ‘read the value
    headerValue=headerCell.Value
    ‘choose the tooltip
    Select Case headerValue
    Case “AA”
    Tooltip=”Tooltip for AA”
    Case “AB”
    Tooltip=”tooltip for AB”
    ‘…more cases
    Case Else ‘default
    Tooltip=””
    End Select
    ‘write the tooltip
    With headerCell.Validation
    .Delete
    .Add Type:=xlValidateCustom
    .InputMessage=tooltip
    End With

    Next headerCell

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro for tooltip

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ 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. Tooltip on picture
    By Mart Marti in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-22-2015, 12:45 PM
  2. How to add a ToolTip in MS Excel 07?
    By jcavigli in forum Excel General
    Replies: 6
    Last Post: 02-01-2013, 12:45 PM
  3. Dynamic Tooltip
    By dolphin_m70 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-09-2007, 07:59 AM
  4. Use a tooltip.
    By sparrow1 in forum Excel General
    Replies: 6
    Last Post: 02-04-2007, 06:30 PM
  5. tooltip like box
    By Jack Zhong in forum Excel General
    Replies: 2
    Last Post: 08-20-2006, 05:45 AM
  6. Multiline Tooltip
    By RobC in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-02-2006, 05:35 PM
  7. Tooltip for my CommandButton
    By LQs in forum Excel General
    Replies: 1
    Last Post: 12-02-2005, 06:00 AM

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