put data in a column into a row

  • Thread starter Thread starter leonidas
  • Start date Start date
L

leonidas

Hi,

I have a worksheet with a lot of data in column B (rows 12 to 242) and
a column J (also rows 12 to 242) where the user can insert numbers.
I would like to create a copy function to copy the vertical data in
column B only when there is a number in column J to a new sheet and put
the vertical data from column B into a horizontal row 12 on this new
sheet.
I only don't know how to do this. Can someone help me? Thanks in
advance!
 
Sub TransposeData()
Dim icol as Long, rng as Range
Dim cell as Range
icol = 1
set rng = Columns(10).specialcells(xlConstants,xlNumbers)
for each cell in rng
Worksheets("Sheet2").Cells(12,icol).Value = cell.offset(0,-1).Value
icol = icol + 1
Next
end sub
 

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

Back
Top