Double-click Event question
(Excel 97)
I am trying to code a print function, so that when a user double clicks on a named range, certain rows of the worksheet are printed. No problem with the printing aspect, but I'm having trouble getting the double click event to work. I prefer to used named ranges instead of the value of the particular cells to make it more generic, also so I don't have to change the code if the cell value changes. Thanks in advance! BW |
Double-click Event question
In the worksheet's code module:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _ Cancel As Boolean) Cancel = True If Not Intersect(Target, Range("MyNamedRange")) Is Nothing Then 'your print code here End If End Sub -- Vasant "Bob Wall" wrote in message ... (Excel 97) I am trying to code a print function, so that when a user double clicks on a named range, certain rows of the worksheet are printed. No problem with the printing aspect, but I'm having trouble getting the double click event to work. I prefer to used named ranges instead of the value of the particular cells to make it more generic, also so I don't have to change the code if the cell value changes. Thanks in advance! BW |
Double-click Event question
Works perfectly, thanks so much!
BW "Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message ... In the worksheet's code module: Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _ Cancel As Boolean) Cancel = True If Not Intersect(Target, Range("MyNamedRange")) Is Nothing Then 'your print code here End If End Sub -- Vasant "Bob Wall" wrote in message ... (Excel 97) I am trying to code a print function, so that when a user double clicks on a named range, certain rows of the worksheet are printed. No problem with the printing aspect, but I'm having trouble getting the double click event to work. I prefer to used named ranges instead of the value of the particular cells to make it more generic, also so I don't have to change the code if the cell value changes. Thanks in advance! BW |
All times are GMT +1. The time now is 05:12 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com