ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   put data in a column into a row (https://www.excelbanter.com/excel-programming/368236-put-data-column-into-row.html)

leonidas[_50_]

put data in a column into a row
 

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!


--
leonidas
------------------------------------------------------------------------
leonidas's Profile: http://www.excelforum.com/member.php...o&userid=35375
View this thread: http://www.excelforum.com/showthread...hreadid=564633


Tom Ogilvy

put data in a column into a row
 
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

--
Regards,
Tom Ogilvy


"leonidas" wrote:


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!


--
leonidas
------------------------------------------------------------------------
leonidas's Profile: http://www.excelforum.com/member.php...o&userid=35375
View this thread: http://www.excelforum.com/showthread...hreadid=564633




All times are GMT +1. The time now is 12:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com