+ Reply to Thread
Results 1 to 5 of 5

Copy & Paste visible cells only

  1. #1
    Scott
    Guest

    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. #2
    Ed
    Guest

    Re: 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" <scott@email.com> wrote in message
    news:42417E50.BF8CFCFE@email.com...
    > 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. #3
    Tom Ogilvy
    Guest

    Re: 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" <scott@email.com> wrote in message
    news:42417E50.BF8CFCFE@email.com...
    > 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. #4
    JE McGimpsey
    Guest

    Re: 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 <42417E50.BF8CFCFE@email.com>, Scott <scott@email.com>
    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. #5
    Scott
    Guest

    Re: 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 <42417E50.BF8CFCFE@email.com>, Scott <scott@email.com>
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1