TRANSPOSE WITHOUT ZEROES(0's)

A

ali

Hi gurus,

Could someone help sort this out. I am using the following code to
transpose rows into columns, skipping blanks. (thanks to gary) Can I
add something to it to skip zeroes as well. I want the code to
transpose all non-zero values but leave no gaps in column.

For example: 123404
would be 12344

Public Sub wede()
Dim lastcol As Long
Dim ws As Worksheet
Set ws = Worksheets("SHEET1")
lastcol = ws.Cells(17, Columns.Count).End(xlToLeft).Column
With ws
..Range(.Cells(17, 1), .Cells(17,
lastcol)).SpecialCells(xlCellTypeConstants).Copy
..Range("A150").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, _
SkipBlanks:=False,Transpose:=True
End With
Application.CutCopyMode = False
End Sub

Could somebody help please.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top