Tharabai
09-12-2015, 01:50 PM
Hi,
I used autofilter and copy pasted the visible cells to a another sheet named "result".
Again I used autofilter with different criteria and copy paste the visible cells after the last used row of sheet "result".
I have used to below code but this includes Header as well. But I want to exclude the header as I am pasting the values after the last used cell.
Range("A2:dG2").Select
Dim rng As Range
Set rng = Application.Intersect(ActiveSheet.UsedRange, Range("A:dG"))
rng.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Dim lastrow As Long
Sheets("result").Select
lastrow = Sheets("result").Range("A1048576").End(xlUp).Row
Sheets("result").Activate
Cells(lastrow + 1, 1).PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
-Tharabai
I used autofilter and copy pasted the visible cells to a another sheet named "result".
Again I used autofilter with different criteria and copy paste the visible cells after the last used row of sheet "result".
I have used to below code but this includes Header as well. But I want to exclude the header as I am pasting the values after the last used cell.
Range("A2:dG2").Select
Dim rng As Range
Set rng = Application.Intersect(ActiveSheet.UsedRange, Range("A:dG"))
rng.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Dim lastrow As Long
Sheets("result").Select
lastrow = Sheets("result").Range("A1048576").End(xlUp).Row
Sheets("result").Activate
Cells(lastrow + 1, 1).PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
-Tharabai