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
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
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
hi,
I know, but wonder that way
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'
hi,
when re-inventing, I might invent something different: )
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
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)Originally Posted by aoc
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.