Results 1 to 4 of 4

Thread: copy with loop double variable

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    copy with loop double variable

    Hi,

    could you please help me with copy from one sheets to another sheet in one workbook. I create this macro for it:
    - I have here one problem if all variable from y is done than the variable z is running +2 e.g.:
    ....sheets("employees").cells(y "8",9).copy sheets("time_data_01").cells(2,4).offset(z "8",0)
    ....sheets("employees").cells(y "3",9).copy sheets("time_data_01").cells(2,4).offset(z "10",0)

    Sub testing()
    Dim y As Long
    Dim z As Long
    For z = 1 To 42
    For y = 3 To 8
        Sheets("employees").Cells(y, 9).Copy Sheets("Time_data_01").Cells(2, 4).Offset(z, 0)
        z = z + 1
    Next y, z
    End Sub
    Last edited by Aussiebear; 08-17-2022 at 05:45 PM. Reason: Added code tags to supplied code

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •