appu_gusai
Member
hi all
i have this code, can anyone correct the code for me?
the above code is working for me, but in same file, when i add new workbooks, its not working for me and i also want to be paste data in new workbooks...
thank's in advance
i have this code, can anyone correct the code for me?
Code:
Sub Get_Data()
Dim lastrowDB As Long, lastrow As Long
Dim arr1, arr2, i As Integer
With Worksheets("Sheet1")
lastrowDB = .Cells(9, "A").End(xlUp).Row
End With
arr1 = Array("B", "O", "P")
arr2 = Array("C", "E", "G")
For i = LBound(arr1) To UBound(arr1)
With Worksheets("Sheet1")
lastrow = Application.Max(5, .Cells(.Rows.Count, arr1(i)).End(xlUp).Row)
.Range(.Cells(5, arr1(i)), .Cells(lastrow, arr1(i))).Copy
End With
Workbooks.Add
With Worksheets("Sheet1")
.Range(arr2(i) & lastrowDB).Resize(lastrow - 4).Value = _
.Range(.Cells(5, arr1(i)), .Cells(lastrow, arr1(i))).Value
End With
Next
Application.CutCopyMode = False
End Sub
the above code is working for me, but in same file, when i add new workbooks, its not working for me and i also want to be paste data in new workbooks...
thank's in advance