Hi,
I have a main sheet, "sheet1" which I filter using the AutoFilter on the Data
Menu along with the VB coding I copied from a book i'm reading. ie:
Sub Copy_with_Autofilter()
Dim rng As Range
With ActiveSheet.AutoFilter.Range
On Error Resume Next
Set rng = .Offset((1, 0).Resize(.Rows.Count - 1, 1) _
.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Not rng Is Nothing Then rng.EntireRow.Copy _
Sheets("Sheet2").Range("A6")
End With
End Sub
The coding works very well, with one exception, it overwrites any data thats
already in sheet2.
Is there any code that I can add to the above so that it will automatically
add data to the next empty row in sheet2.
Will be grateful for any help.
I have a main sheet, "sheet1" which I filter using the AutoFilter on the Data
Menu along with the VB coding I copied from a book i'm reading. ie:
Sub Copy_with_Autofilter()
Dim rng As Range
With ActiveSheet.AutoFilter.Range
On Error Resume Next
Set rng = .Offset((1, 0).Resize(.Rows.Count - 1, 1) _
.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Not rng Is Nothing Then rng.EntireRow.Copy _
Sheets("Sheet2").Range("A6")
End With
End Sub
The coding works very well, with one exception, it overwrites any data thats
already in sheet2.
Is there any code that I can add to the above so that it will automatically
add data to the next empty row in sheet2.
Will be grateful for any help.