» Display a record with a right mouse click using VBA in Microsoft Excel
CATEGORY - General Topics in VBA
VERSION - All Microsoft Excel Versions
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:
- The South Beach Diet: The Delicious, Doctor-Designed, Foolproof Plan for Fast and Healthy Weight Loss
- The Complete Book of Business Plans: Simple Steps to Writing a Powerful Business Plan (Small Business Sourcebooks)
- Business Analysis with Microsoft Excel (2nd Edition)
- A Mathematician Plays the Stock Market
- Microsoft PowerPoint Version 2002 Step by Step
- Windows XP Pocket Reference
No comments have been submitted.

