PDA

View Full Version : Delete the last row that was filled



mary.m.t
01-26-2012, 02:09 AM
Hi there!
I have a Excel with 2 sheet, in the first sheet if the cell E2 has one of this values "aa" "bb", "cc" and the O2 has one of this values "DD", "ee", "ff”. The cells c2, f2: l2 will be copied in sheet 2 to cells a2: h2 and it will send my in Sheet2. I want to delete copied cells in Sheet2, if O2's value will change. Example: Sheet1 is filled with some values and I put in O2 value 'dd' and automatically the data from c2, f2: l2 sheet1 will be copied in sheet 2 at a2: h2 and send me there. After 2 min I realize it's not "dd" and i change the value of o2 in "ee" I want to erase what was copied in this case and recopy de information.

Add info: For copy cell and send me from a sheet in to another i have macros.
Can i do such o thing? I’ve tried with this code but it does’t work


If Sheets("Master").Range(“o2”).Offset(1,0).End(xlup).HasChanges() Then
Sheets("Frauda").Cells(lRow, iCol).End(xlUp).Offset(1, 0).ClearContents
Sheets("Frauda").Cells(lRow, "A").End(xlUp).Offset(1, 0).ClearContents
Else
End If

Thanks!