Is It possible

  • Thread starter Thread starter GW Dyson
  • Start date Start date
G

GW Dyson

Private Sub Worksheet_change(ByVal Target As Range)
If Target.Address <> "$S$4" Then Exit Sub
Cells(Cells(Rows.Count, "s").End(xlUp).Row + 1, "s") = Target
End Sub

Is it possible to use this in more than 1 place in a worksheet.
Thank You
 
Hi ...,
The very first instruction indicates that the active cell
must be $S$4 so I think the answer you are looking
for is no. Any change made within that cell places it's
value at the bottom of column "S" as seen in the CELLS
instruction..

What is it that you actually want to do.

If you just want to make sure you are somewhere in
column "S" with a value that doesn't look like a blank
you could use something like this at the beginning.

If Target.Column <> "S" or TRIM(Target.Value) = "" then exit sub

If you wanted to do the same as the original for any value
entered in row 4 in any column.

Private Sub Worksheet_change(ByVal Target As Range)
If Target.Row<> 4 Then Exit Sub
If TRIM(Target.Value) = "" then Exit Sub
Cells(Cells(Rows.Count, target.column). _
End(xlUp).Row + 1, target.Column)= Target.value
End Sub
 
GW Dyson said:
Private Sub Worksheet_change(ByVal Target As Range)
If Target.Address <> "$S$4" Then Exit Sub
Cells(Cells(Rows.Count, "s").End(xlUp).Row + 1, "s") = Target
End Sub

Is it possible to use this in more than 1 place in a worksheet.
Thank You

Seasonal Oil Change Grease
1/7/04 3/4/04
DATE DATE

10/9/03
11/12/03
12/10/03
1/7/04

The cell at the top with 1/7/04 is copyed and pasted here from another
workbook using a macro and then it puts it in the column below without over
writing the last date. What I need to do is the same thing with the grease
listing, on this same sheet.
Thanks very much for you help.
 
Hi Glenn,
Private Sub Worksheet_change(ByVal Target As Range)
If Target.Row<> 4 Then Exit Sub
If Target.Column <> 14 and target.column <> 19 then Exit Sub '--M or S
If TRIM(Target.Value) = "" then Exit Sub
Cells(Cells(Rows.Count, target.column). _
End(xlUp).Row + 1, target.Column)= Target.value
End Sub
 
Back
Top