I have to copy values from one worksheet, to another and I cant write the code without error 438. This is the Orignal Sheet and I have to create a script which copies each column, to the last row, and pastes it into other sheet as one column, example.
The code:
Sub CopyPaste()
Dim origws As Worksheet
Dim destws As Worksheet
Dim i As Long 'Column counter
Dim j As Long 'Row Counter
Dim k As Long 'Counter in NewSheet
Set origws = Sheets("31 - 61 kolona")
Set destws = Sheets("Slaganje")
k = 1
Worksheets("31 - 61 kolona").Activate 'Activateing original WorkSheet
'Looping through the sheet
For i = 1 To 1000
For j = 1 To 1000
If IsEmpty(Cells(j, i)) Then 'If there is an blank cell, move to next column
Exit For
End If
Cells(j, i).Copy 'copy value from cell
Worksheets("Slaganje").Activate 'Activate destination sheet
Cells(k, 1).Paste 'paste the copied cell in the destination sheet
k = k + 1 'move counter to next row
Worksheets("31 - 61 kolona").Activate 'activate original sheet
Next j 'move to next row
Next i 'move to next column
End Sub
This is my attempt, hope you can help me.