Hi guys
I have this code from a professional member of mrexcel
I want 2 things if anyone can added
1:this is work by run a macro, i want this is will be automated
2:i want sheet2 in this code will be hidden
I have this code from a professional member of mrexcel
Code:
Sub MyCopyRange()
Dim nr As Long
Dim i As Long
Application.ScreenUpdating = False
' Set initial value of next row
nr = 34
' Copy range
For i = 2 To 30840 Step 1
' Copy Range based Cell B66 & B98
If Sheets("sheet1").Range("B" & (nr - 2) * i + 2).Value <> "" Then
Sheets("sheet2").Range("A" & nr * (i - 1) + 7 & ":H" & nr * i + 6).Copy Sheets("sheet2").Range("A" & nr * i + 7)
' Add 34 to next row
Else
Exit Sub
End If
Next i
Application.ScreenUpdating = True
End Sub
I want 2 things if anyone can added
1:this is work by run a macro, i want this is will be automated
2:i want sheet2 in this code will be hidden