Hi to all
I want to copy only the rows from sheet "data" to sheet "copy_data" using range (i need only until column "m"
I use this but i'm not able to make it work
Any help??
I want to copy only the rows from sheet "data" to sheet "copy_data" using range (i need only until column "m"
I use this but i'm not able to make it work
VBA Code:
Sub Copy_Data()
Dim i, j, LastRow As Long
Dim r As Range
'Find last row in sheet Data
With Sheets("Data")
LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
End With
'Clear Sheet Copy_Data
With Sheets("Copy_Data")
.Select
Selection.Delete Shift:=xlUp
End With
j = 1
For i = 2 To LastRow
If Worksheets("Data").Cells(i, 1).Value <> "" Then
With Sheets("Data")
Range(Cells(i, "A"), Cells(i, "M")).Select
End With
With Sheets("Copy_Data")
Range(Cells(j, "A"), Cells(j, "M")).PasteSpecial Paste:=xlValues
End With
j = j + 1
End If
Next i
End Sub
Any help??