Hi anyone,
The following code copies filterred data rows from the active workbook sheet and pastes them in the destination workbook if both workbooks are open.
How could I make the code to open the Book2.xlsx; paste the copied data and close the workbook with the VBA code without having manually to do that.
Any help on this would be kindly appreciated.
The following code copies filterred data rows from the active workbook sheet and pastes them in the destination workbook if both workbooks are open.
Code:
Sub Copy()
Dim Rng As Range
Set Rng = Worksheets("Mem").Columns("D")
Set Rng = Rng.Resize(65535, 1).Offset(1, 0)
Set Rng = Rng.Resize(, 3).SpecialCells(xlCellTypeVisible)
Rng.Copy Workbooks("Book2.xlsx").Worksheets("Mem").Range("D17")
End Sub
How could I make the code to open the Book2.xlsx; paste the copied data and close the workbook with the VBA code without having manually to do that.
Any help on this would be kindly appreciated.