Ok, I can't get that code to work for whatever reason. Below is what I currently have and it works pretty well, with the exception that it doesn't put the date at the end of the moved rows on "completed" sheet.
If you can also look at this and tell me if there's a way to prevent the initial popup that warns about the workbook not being shared during this process.
Private Sub CommandButton1_Click()
'Sub ArchiveInactive()
'JBeaucaire (2/3/2010)
'Move "inactive" clients to another worksheet
Dim LR As Long, NR As Long, wsI As Worksheet
If ActiveWorkbook.MultiUserEditing Then
ActiveWorkbook.ExclusiveAccess
End If
Set wsI = Sheets("Completed") 'TARGET sheet
If ActiveSheet.Name = wsI.Name Then 'make sure the SOURCE sheet is active
MsgBox "Start macro from data sheet"
Exit Sub
End If
NR = wsI.Range("A" & Rows.Count).End(xlUp).Row + 1
If NR = 2 Then Rows("1:1").Copy wsI.Range("A1") 'add titles if needed
Columns("W:W").AutoFilter
Columns("W:W").AutoFilter Field:=1, Criteria1:="yes"
LR = Range("W" & Rows.Count).End(xlUp).Row
If LR > 1 Then 'verify there is data to transfer, then do it
Range("A2:W" & LR).SpecialCells(xlCellTypeVisible).Copy wsI.Range("A" & NR)
Range("A2:W" & LR).SpecialCells(xlCellTypeVisible).Delete xlShiftUp
End If
ActiveSheet.AutoFilterMode = False
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs ("\\CAB-NET-SVR1\Traffic\Traffic.xlsm"), , , , , , xlShared
ActiveWorkbook.Saved = True
Application.DisplayAlerts = True
End Sub
Bookmarks