Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 399
Default 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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
COPY PASTE VALUES ONLY FROM/ON VISIBLE CELLS FARAZ QURESHI Excel Discussion (Misc queries) 6 April 29th 09 01:32 PM
Copy and paste visible cells to outlook Tania UK Excel Discussion (Misc queries) 1 June 26th 07 02:56 PM
Copy/Paste Visible cells only Ashley Excel Discussion (Misc queries) 1 October 17th 06 09:17 PM
Copy & Paste Visible Cells with Formulas Ricky Excel Worksheet Functions 5 January 27th 05 05:37 PM
Select Visible Cells only copy & Paste Kim Excel Programming 2 August 10th 04 03:18 AM


All times are GMT +1. The time now is 11:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"