PDA

View Full Version : Solved: Action code 2 only in cells



marreco
01-28-2012, 04:34 AM
I would like the code below only works in cells, "L6" and "M6".

This is to leave the other free cells without the action of the code that's possible?

I'm try ...but dont work:think:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target <> Range("L6") And Range("M6") Then Exit Sub
If Target.Cells.Count <> 1 Then Exit Sub
Change.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0) = Target.Value


End Sub

p45cal
01-28-2012, 06:22 AM
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count <> 1 Then Exit Sub
If Intersect(Target, Range("L6:M6")) Is Nothing Then Exit Sub
Cells(Rows.Count, 1).End(xlUp).Offset(1, 0) = Target.Value
End Sub
untested.

marreco
01-28-2012, 06:37 AM
It was perfect! :clap:
Thank you very much!
how to put the post as solved?:think:

p45cal
01-28-2012, 07:17 AM
Thread Tools at the top of the thread, last option is Mark Solved, Perform Action.

marreco
01-28-2012, 07:50 AM
I dont known