+ Reply to Thread
Results 1 to 2 of 2

Is there a way to paste special --> Transpose and delete blanks?

  1. #1

    Is there a way to paste special --> Transpose and delete blanks?

    Is there a way to paste special --> Transpose and delete blanks for a
    group of data?

    i.e.

    A
    <blank>
    B
    <blank>
    C
    <blank>

    to:

    A | B | C

    ?

    I tried paste special --> transpose checked, skip blanks checked which
    doesn't work..

    Thanks in advance!
    JuniperTree


  2. #2
    Dave Peterson
    Guest

    Re: Is there a way to paste special --> Transpose and delete blanks?

    You could always clean up after you did the pasting.

    If you were doing it by hand, you could select the pasted range and then
    edit|goto|special|blanks
    edit|delete|shift to the left

    In code:

    Option Explicit
    Sub testme()

    Dim RngToCopy As Range
    Dim DestCell As Range

    With ActiveSheet
    Set RngToCopy = .Range("a1:b7")
    Set DestCell = .Range("C9")
    End With

    RngToCopy.Copy
    DestCell.PasteSpecial Transpose:=True

    'just in case there are no empty cells
    On Error Resume Next
    DestCell.Resize(RngToCopy.Columns.Count, ngToCopy.Rows.Count) _
    .Cells.SpecialCells(xlCellTypeBlanks).Delete shift:=xlToLeft
    On Error GoTo 0


    End Sub


    [email protected] wrote:
    >
    > Is there a way to paste special --> Transpose and delete blanks for a
    > group of data?
    >
    > i.e.
    >
    > A
    > <blank>
    > B
    > <blank>
    > C
    > <blank>
    >
    > to:
    >
    > A | B | C
    >
    > ?
    >
    > I tried paste special --> transpose checked, skip blanks checked which
    > doesn't work..
    >
    > Thanks in advance!
    > JuniperTree


    --

    Dave Peterson

+ 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