PDA

View Full Version : Solved: BeforeDoubleClick setting column and row?



coliervile
03-15-2007, 10:44 AM
In the following macro the columns are set, but my question is can you set the columns to start on a specified row (e.g. column 1 row 4)??? What I want is for the "doubleclick" to star in Columns 1,2,12 and 13 on row 4 and continue down from there.

Regards,
Charlie

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Select Case Target.Column
Case 1, 2
If Target = "" Then
Target = "a"
Target.Font.Name = "marlett"
Else: Target = ""
End If
Cancel = True
Case 12:
If Target = "" Then
Target = "Williamson"
Else: Target = ""
End If
Cancel = True
Case 13:
If Target = "" Then
Target = "Michaelson"
Else: Target = ""
End If
Cancel = True
Case Else: Exit Sub
End Select

End Sub

mdmackillop
03-15-2007, 11:27 AM
Just exit the sub if the row number is less than 4
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Row < 4 Then Exit Sub
Select Case Target.Column
'etc.

coliervile
03-15-2007, 12:08 PM
"md" you never cease to amaze me....it works great. Thanks for you kelp item resolved.

Best regards,

Charlie