Excel/Transfering without duplicating
Good day. I have a sheet that in column P tells me when a piece of equipment is "Running" or "DOWN". Once the machine goes from running to down, in column Q I have a timestamp that tells me when it went down. Once down I have a button on top that I hit and it transferes any DOWN over to another sheet called "LOG". The only problem Iam having with this is that I have to update this sheet alot during the day and whenever I hit the transfer button it transfers everything again, even the ones that have already been transfered earlier. Is there a way to get it to recognise the timestamp or something so that it will not duplicate unless the time has changed. Here is what Iam using right now.
Application.ScreenUpdating = False
If Not Intersect(Target, Range("P:P")) Is Nothing Then
If Target.Value = "WELL DOWN" Then
Range("B" & Target.Row, "BH" & Target.Row).Copy
Sheets("LOG").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
Application.CutCopyMode = False
Application.ScreenUpdating = True
Any help would be greatly appreciated.
Thanks in advance
At the moment, the macro is doing a copy and paste based only on the target.value - I think it would need to do two other checks - firstly, a countif to determine if the line exists on the LOG sheet - if it doesn't it would copy it. If it DOES, then it would need to do a lookup to get the timestamp and if that is the same do nothing, otherwise either copy or update the existing entry.
Let me know if you need any help with coding any of the above - for both my suggestions, application.worksheetfunction would do it.
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here