+ Reply to Thread
Results 1 to 3 of 3

Show help message depending on selected cell

  1. #1
    Registered User
    Join Date
    08-16-2015
    Location
    Barcelona
    MS-Off Ver
    MAC 2011
    Posts
    2

    Show help message depending on selected cell

    I would like Excel to show messages on the screen depending on the cell selected by the user. The idea is to offer assistance on what sort of information is to be entered when the user locates the cursor on a cell, typically a heading.

    I have prepared some easy VBA code that calls for a combination of Match and Index functions. The code is below. The problem is that it only works if the cell in which the user is locating the cursos is not combined. The problem is that I have many headings that are the result of combining two or more cells into one and I would like to have a solution that works also in such cases. This is why I would really appreciate some assistance on this matter.

    Note: if someone has a different solution to achieve the same, that could also be handy.

    Thanks,

    Marc

    VBA CODE:

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim wsCt As Worksheet
    Dim strCt As String
    Dim mchCt As String
    Dim rngCt As Range
    Set wsCt = Worksheets("CONFIGURATION")
    Set rngCt = wsCt.Range("CommentList")
    Set rowCt = wsCt.Range("CommentRow")

    On Error Resume Next

    mchCt = Application.WorksheetFunction.Match(Target.Value, rowCt, 0)
    strCt = Application.WorksheetFunction.Index(rngCt, mchCt + 1, 1)
    Range("c1").Value = strCt

    End Sub

  2. #2
    Forum Contributor
    Join Date
    04-15-2015
    Location
    beirut
    MS-Off Ver
    2010
    Posts
    107

    Re: Show help message depending on selected cell

    change the line
    Dim strCt As String
    to
    Dim strCt As long

  3. #3
    Registered User
    Join Date
    08-16-2015
    Location
    Barcelona
    MS-Off Ver
    MAC 2011
    Posts
    2

    Re: Show help message depending on selected cell

    Thanks Salim but when I do so, it appears a 0 in C1 regardless of the cell where the cursor is located.
    Any other suggestions will be highly appreciated. :-)
    Thanks.

+ 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. [SOLVED] Worksheet change value depending on what cell is selected... HOW?
    By heuder in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-25-2014, 10:18 PM
  2. Cell linked to checkboxes depending on what is selected
    By lmshow in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-18-2013, 01:29 PM
  3. Replies: 2
    Last Post: 01-30-2013, 03:16 AM
  4. displaying in a message box whole rows depending on a cell's value
    By ordeayn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-01-2012, 06:40 AM
  5. Replies: 4
    Last Post: 09-29-2010, 04:36 AM
  6. [SOLVED] Cell data depending on column selected.
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-01-2006, 06:00 AM
  7. [SOLVED] Want add color to the cell depending on the value selected from th
    By viksha in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-16-2005, 03:05 PM
  8. pop up message depending on cell value
    By John Davies in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-29-2005, 07:05 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