Hi there,
maybe Your task can be done in shorter variation, but following code should work:
Option Explicit
Sub CopyToNextSheet()
Dim Sht1, Sht2 As Worksheet
Dim PosCount As Integer
Dim Row1 As Integer: Row1 = 1
Dim Row2 As Integer
Set Sht1 = Sheets("Sayfa1")
Set Sht2 = Sheets("Sayfa2")
Do Until Sht1.Cells(Row1, 1) = ""
PosCount = WorksheetFunction.CountA(Sht1.Rows(Row1)) - 1
Select Case Sht2.Cells(1, 2)
Case Is = vbNullString
Row2 = 1
Case Is >= 1
Row2 = Sht2.UsedRange.Rows.Count + 1
End Select
If PosCount > 0 Then
Sht2.Cells(Row2, 2).Resize(PosCount) = Sht1.Cells(Row1, 1)
Sht1.Cells(Row1, 2).Resize(, PosCount).Copy
Sht2.Cells(Row2, 1).PasteSpecial Paste:=xlPasteAll, Transpose:=True
Else
Sht2.Cells(Row2, 2) = Sht1.Cells(Row1, 1)
End If
Row1 = Row1 + 1
Loop
Application.CutCopyMode = False
End Sub
Hope it helps
Bookmarks