Hi
If I understand your question .........
The best way is to put the code into a separate Sub and call that Sub from the event - and then it is available to be called from anywhere in scope.
Private Sub DataGridView1_CellContentClick(sender As Object,
e As DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
SomeCode()
End Sub
Sub SomeCode()
MessageBox.Show("Well well, so you finally managed to get out of your bed!")
End Sub