find first empty cell in column and start transpose next row in that cell

A

ali

Hi guys,

I have the following code to transpose one row into column without
blanks and zero's.

Dim lastcol As Long
Dim ws As Worksheet
Set ws = Worksheets("sheet10")
lastcol = ws.Cells(17, Columns.Count).End(xlToLeft).Column
With ws
..Range(Cells(17, 1), Cells(17, lastcol)).Replace 0, ""
..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


I want to be able to transpose many rows into the same column and in
that column I want no empty cells.

row1: 1 2 blank 0 3
row2: 22 33 0 44

after transpose it will look as following:

1

2

3

22

33

44

would greatly appreciate your help.

Thanks

ali
 
A

ali

PLS do NOT post everywhere. NOT a good way to make friends.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software










- Show quoted text -

sorry mate. I thought that different users use different forums. But
I'll be careful. Thanks for your code.

Regards

ali
 
R

Rick Rothstein \(MVP - VB\)

From a post by Jeff Johnson (in the compiled VB newsgroups):

"You have posted this question individually to multiple groups. This is
called Multiposting and it's BAD. Replies made in one group will not be
visible in the other groups, which may cause multiple people to respond to
your question with the same answer because they didn't know someone else
had already done it. This is a waste of time.

If you MUST post your message to multiple groups, post a single message and
select all the groups (or type their names manually in the Newsgroups field,
separated by commas) in which you want it to be seen. This is called Cross
posting and when used properly it is GOOD."

Some additional comment previously posted by me:

"You may not see this as a problem, but those of us who volunteer answering
questions on newsgroups do see it as a problem. You can't imagine how
annoying it is for a volunteer to read a question, research background
material, test sample code and then formulate and post an answer to the
original question only to go to another newsgroup and find the question
posted and ALREADY answered over there. On top of that, if you cross-post
your question, all of the readers in all the newsgroups it is cross-posted
to see both the original question and all of the answers given to it. This
is beneficial to you because then we can add additional material to, add
clarification to, as well as add additional examples to an answer you have
received previously... that means you end up with a more complete solution
to your problem. This is a win-win situation for all of us."

Rick
 

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