I've looked around the internet to find an answer to my problem. I need to be able to copy data from sheet1 to sheet2 in Excel, however the rows should be turned into columns.
In sheet1 I have Title, Scope and Deadline listed in column A, and in column B the data provided to these headlines. In sheet2 I want to click on a CommandButton, which gives me Title, Scope and Deadline in A1, B1 and C1 respectively and the data below these headlines. Doing this the code should pick every fourth line in sheet1 when listing the Title in sheet2 and so on.
I have tried a little bit, put can not make it. My thoughts is to use some kind of loop.
Private sub CommandButton1_Click()
shSource=WorkSheets("Sheet1")
shDest=WorkSheets("Sheet2")
LastRow = shSource.Range("A" & Rows.Count).End(xlUp).Row
For i = 1 To LastRow
Range("A1").Offset(4, 0).Select
Selection.Copy
shDest.Select
shDest.Range("A1").Select
If shDest.Range("A1").Offset(1, 0) <> "" Then
shDest.Range("A1").End(xlDown).Select
End If
ActiveCell.Offset(1, 0).Select
ActiveCell.Paste
Next i
End Sub
I really hope some of you can help me. Thanks, Michelle