ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy & Paste visible cells only (https://www.excelbanter.com/excel-programming/326020-copy-paste-visible-cells-only.html)

Scott

Copy & Paste visible cells only
 
Is it possible to copy and paste visible cells only?

Thanks


Selection.Copy
'Add a new workbook and copy selected range
Workbooks.Add
Range("a1").Select
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False



Ed

Copy & Paste visible cells only
 
In Excel 2000, I use only
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=_
False, Transpose:=False
and it works fine for me. Yes, you'd have to add the Paste Formats to get
that; I didn't bother. But it did paste only the cells visible after
AutoFilter and hiding.

HTH
Ed

"Scott" wrote in message
...
Is it possible to copy and paste visible cells only?

Thanks


Selection.Copy
'Add a new workbook and copy selected range
Workbooks.Add
Range("a1").Select
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False





Tom Ogilvy

Copy & Paste visible cells only
 
Unless you data is from a filtered range, you would have to copy only the
visible cells

Edit=Goto =Special, select Visible.

Then do your copy



---
Regards,
Tom Ogilvy


"Scott" wrote in message
...
Is it possible to copy and paste visible cells only?

Thanks


Selection.Copy
'Add a new workbook and copy selected range
Workbooks.Add
Range("a1").Select
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False





JE McGimpsey

Copy & Paste visible cells only
 
One way:

Dim rCopy As Range
On Error Resume Next 'in case no visible cells selected
Set rCopy = Selection.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Not rCopy Is Nothing Then _
rCopy.Copy Destination:=Workbooks.Add.Sheets(1).Range("A1")



In article , Scott
wrote:

Is it possible to copy and paste visible cells only?

Thanks


Selection.Copy
'Add a new workbook and copy selected range
Workbooks.Add
Range("a1").Select
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False


Scott

Copy & Paste visible cells only
 
Thank you! That worked great.




JE McGimpsey wrote:

One way:

Dim rCopy As Range
On Error Resume Next 'in case no visible cells selected
Set rCopy = Selection.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Not rCopy Is Nothing Then _
rCopy.Copy Destination:=Workbooks.Add.Sheets(1).Range("A1")

In article , Scott
wrote:

Is it possible to copy and paste visible cells only?

Thanks


Selection.Copy
'Add a new workbook and copy selected range
Workbooks.Add
Range("a1").Select
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False




All times are GMT +1. The time now is 06:02 PM.

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