Copy Cell from one sheet to specific Col value

  • Thread starter Thread starter smandula
  • Start date Start date
S

smandula

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
 
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.
 
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
 
Back
Top