ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Cell from one sheet to specific Col value (https://www.excelbanter.com/excel-programming/441596-copy-cell-one-sheet-specific-col-value.html)

smandula

Copy Cell from one sheet to specific Col value
 
Hello,

Need help in a VBA format.
Sheet2 has a column of 15 rows, random numbers. i.e.H2 to H16

I need to sort these cells on Sheet1 with column headings 1 to 49
starting at row A25 going down again 15 rows A39

Therefore,that I may visually see a pattern of these 15 numbers.

With Thanks

Dave Peterson

Copy Cell from one sheet to specific Col value
 
Record a macro when you:
Edit|Copy H2:H16 of sheet2
Edit|Pastespecial|Transpose onto A25 of sheet1
and continue to record when you sort A25:A39

And you'll have code that works ok.

But if you need help tweaking your recorded code, post back with what you have.
I'm sure you'll get help.

smandula wrote:

Hello,

Need help in a VBA format.
Sheet2 has a column of 15 rows, random numbers. i.e.H2 to H16

I need to sort these cells on Sheet1 with column headings 1 to 49
starting at row A25 going down again 15 rows A39

Therefore,that I may visually see a pattern of these 15 numbers.

With Thanks


--

Dave Peterson

smandula

Copy Cell from one sheet to specific Col value
 
The Code listed below works on the same sheet.
I want the data Column to be on Sheet2
Stratified into the appropriate on sheet starting at row A25
'-----------------------------------------------------------
Sub RandomNumber()
Dim cell As Range
Dim lRow As Long
Dim lColumn As Long
Application.ScreenUpdating = False
For Each cell In _
Range("H2:H" & _
Range("H65536").End(xlUp).Row)
lRow = cell.Row
lColumn = cell.Value
Cells(lRow, lColumn) = cell.Value
Next 'cell
Application.ScreenUpdating = True
End Sub
'------------------------------------------------------------------

If possible change H65536 to H16

With Thanks


All times are GMT +1. The time now is 10:34 AM.

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