» Display a record with a right mouse click using VBA in Microsoft Excel
CATEGORY - General Topics in VBA
VERSION - All Microsoft Excel Versions
Question: The row of an active cell is to be displayed in a message box with a right mouse click in columns A:E
Answer:
Insert the following code in the appropriate modules.
Place the code below into the This Workbook module.
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Dim intCounter As Integer
Dim txt As String
If Target.Column > 5 Then Exit Sub
Cancel = True
For intCounter = 1 To 5
txt = txt & Cells(Target.Row, intCounter) & vbLf
Next intCounter
MsgBox txt
End Sub
Book Store:
Recommended Books:
- Rich Dad's Guide to Investing: What the Rich Invest in, That the Poor and the Middle Class Do Not!
- The Total Money Makeover. : A Proven Plan for Financial Fitness
- The 22 Immutable Laws of Marketing : Exposed and Explained by the World's Two
- The Analysis and Use of Financial Statements
- The Ernst & Young Business Plan Guide
- Microsoft Office Xp: Advanced Concepts and Techniques: Word 2002, Excel 2002, Access 2002, Powerpoint 2002
No comments have been submitted.

