Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / July 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
junipertree@gmail.com - 26 Jul 2006 23:07 GMT
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 - 26 Jul 2006 23:23 GMT
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

> Is there a way to paste special --> Transpose and delete blanks for a
> group of data?
[quoted text clipped - 19 lines]
> Thanks in advance!
> JuniperTree

Signature

Dave Peterson


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.