Consulting

Results 1 to 7 of 7

Thread: right click

  1. #1
    VBAX Regular aoc's Avatar
    Joined
    Apr 2007
    Location
    Istanbul
    Posts
    90
    Location

    right click

    hi,

    in n9 cell, when I right click mouse, I want to see a list containing numbers from 1 to 20.when I right click any number will be seen in the cell .

    regards

  2. #2
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,053
    Location
    Why not make a "list' and have the cell refer to this ?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  3. #3
    VBAX Regular aoc's Avatar
    Joined
    Apr 2007
    Location
    Istanbul
    Posts
    90
    Location
    hi,

    I know, but wonder that way

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Why reinvent the wheel? Use Data Validation as Aussiebear suggests.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    VBAX Regular aoc's Avatar
    Joined
    Apr 2007
    Location
    Istanbul
    Posts
    90
    Location
    hi,

    when re-inventing, I might invent something different: )

  6. #6
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,053
    Location
    Different perhaps.... but would it work?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  7. #7
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    Quote Originally Posted by aoc
    hi,

    when re-inventing, I might invent something different: )
    If you really want to try, use the before right click event. The code for the numbers is up to you. I suggest using a form (without caption) with a listbox on it.[vba]Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
    If Sh.Name = "Sheet1" Then
    'Right click on A2 to A20 and C2 to C20 on sheet1
    If Not Intersect(Target, Range("A2:A20,C2:C20")) Is Nothing Then
    Cancel = True
    MsgBox "Here the code for the numbers ..."
    End If
    End If
    End Sub
    [/vba]Charlize

    ps. When double clicking the listbox on a number you can even insert the chosen number (so you don't need an extra commandbutton.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •