Firstly, I would like to apologise if this has already been resolved in previous thread(s). I have searched with no success.
I have a Workbook called: Company Documents Register, which as the name states, is a Register of all Company Documents.
Within this workbook, I have the following worksheets:
Is used for Data Entry. All document info is entered into this worksheet only.
The following code is assigned to a Command Button to copy all rows that contain the cell value 'haccp'.
Private Sub Command_Click() Application.ScreenUpdating = False Columns(3).AutoFilter 1, "haccp" With Range("a2", Range("h" & Rows.Count).End(3)) .Copy Sheet2.Cells(Rows.Count, 1).End(3).Offset(1) End With Columns(3).AutoFilter Application.ScreenUpdating = True End Sub
This is working perfectly.....with one exception.
ISSUE TO BE RESOLVED
Currently, each time the macro is run, it copies all filtered results and pastes them onto sheet2 as new entries however I require it to replace all data beginning at row 2 (as row 1 contains headings). Is it possible to have sheet2 data replaced each time the macro is run?
I am currently deleting the data from sheet2 prior to clicking the command button as to not duplicate each entry on sheet2.
Thanks in advance for your time, please let me know if you require any clarification or further info..