ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need Macro to Copy Visible Cells to New Sheet (https://www.excelbanter.com/excel-programming/271695-re-need-macro-copy-visible-cells-new-sheet.html)

Don Guillett[_4_]

Need Macro to Copy Visible Cells to New Sheet
 
try these

Sub copyvis1()
ActiveSheet.Cells.SpecialCells(xlCellTypeVisible). Rows.Copy
Destination:=[sheet5!a6]
End Sub

Sub copyvis()
slr = Range("a65536").End(xlUp).Row
For Each c In Range("a5:a" & slr)
x = Sheets("sheet5").Range("a65536").End(xlUp).Row + 1
If c.EntireRow.Hidden < True Then
c.EntireRow.Copy Destination:= _
Sheets("sheet5").Range("a" & x)
End If
Next
End Sub

--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Progster" wrote in message
...
Hi. I've recently added the use of 'Advanced Filter' to my bag-o-tricks,
and I find that what I would really like to do is to perform the AF "in
place", and then copy the visible cells to a new sheet.

I know it is possible to have the AF output it's results to another
(already existing) sheet, but I find this process cumbersome and
unintuitive.

Could it be that others have felt this way before me, and created a macro
which will grab visibile rows (the results of a filter operation), create

a
new sheet, and place a copy of those rows on the new sheet?

If so, I'd really appreciate it if one or more such solutions might show

up
here!






All times are GMT +1. The time now is 09:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com