Code:
Sub datatrasfer()
Dim k As Integer
Dim j As Integer
Dim l As Integer
Dim n As Integer
Sheets("sheet6").Activate
j = 1
k = j + 1
l = 9
n = l + 1
Do Until j = 15000
If Cells(j, 1).Value = "" And Cells(k, 1).Value <> "" Then
Sheets(Sheet1).Cells(l, 19).Value = Cells(k, 1).Value
Sheets(Sheet1).Cells(n, 19).Value = Cells(k, 1).Value
j = j + 1
l = l + 2
Else
j = j + 1
End If
Loop
End Sub
I want to transfer data from sheet 6 to sheet 1 if the condition in sheet 6 meet the condition in my "if" statements.
I tried with "and" instead of 2 "if" but it return error 1004.
Now it goes to sheet 6 and nothing happens no error no nothing.
Any idea how to solve the problem.
Last edited by a moderator: