Hello,
I have some questions on intersect code.
I am trying to make the following code put a matched in range s2:s500 when a user double clicks on the cell. I would also like this code to be in workbook so when a user open excel the code works.
For intersect code is it possible to change the code if a user clicks on cellA1 sheet1 it takes them to cella1 sheet 3? I kept getting error message when I tried to change this code and found little information on intersect method.
Here is the code I get error at matched line (i want to the code to also change the cell to normal if user clicks on cell after matched is in cell) (sorry for my english)
Private Sub Worksheet_SelectionChange(ByVal target As Range)
If target.Cells.Count > 1 Then Exit Sub
If Not Intersect(target, Range("S2:S500")) Is Nothing Then
target.Font.Name = "Marlett"
'target.ActiveCell.FormulaR1C1 = "Matched"
If target = vbNullString Then
target = "S"
Else
target = vbNullString
End If
End If
End Sub
I have some questions on intersect code.
I am trying to make the following code put a matched in range s2:s500 when a user double clicks on the cell. I would also like this code to be in workbook so when a user open excel the code works.
For intersect code is it possible to change the code if a user clicks on cellA1 sheet1 it takes them to cella1 sheet 3? I kept getting error message when I tried to change this code and found little information on intersect method.
Here is the code I get error at matched line (i want to the code to also change the cell to normal if user clicks on cell after matched is in cell) (sorry for my english)
Private Sub Worksheet_SelectionChange(ByVal target As Range)
If target.Cells.Count > 1 Then Exit Sub
If Not Intersect(target, Range("S2:S500")) Is Nothing Then
target.Font.Name = "Marlett"
'target.ActiveCell.FormulaR1C1 = "Matched"
If target = vbNullString Then
target = "S"
Else
target = vbNullString
End If
End If
End Sub