Hi Guys,
The following code is what I use to copy rows from my excel report depending on the outcome of a particular colum to another sheet. However what I would like to know is instead of just copying the rows over, I want to move the rows completly out of the "Main" Sheet to the specified sheet.
Code as follows:
Dim Mfile As String
Dim Dsh As String
Dim Rend As Long
Dim Dd As Long
Dim Nend As Long
Dsh = "Main"
Mfile = ActiveWorkbook.Name
Workbooks(Mfile).Activate
Sheets(Dsh).Select
Rend = Cells(65536, 1).End(xlUp).Row
For Dd = 1 To Rend
Select Case Cells(Dd, 6)
Case "1"
Nend = Sheets("Missing1").Cells(65536, 1).End(xlUp).Row + 1
Rows(Dd).Copy Destination:=Sheets("Missing1").Cells(Nend, 1)
End Select
Next Dd
Sheets("Sheet2").Select
Columns("F:F").Select
Selection.ClearContents
Range("A1").Select
End Sub
Now this part of my code is used to copy the lines:
Select Case Cells(Dd, 6)
Case "1"
Nend = Sheets("Missing1").Cells(65536, 1).End(xlUp).Row + 1
Rows(Dd).Copy Destination:=Sheets("Missing1").Cells(Nend, 1)
But what I want to know is there away to change the "Copy Destination" to a move function?
Hope I have giving enough info.
Cheers
Colin
The following code is what I use to copy rows from my excel report depending on the outcome of a particular colum to another sheet. However what I would like to know is instead of just copying the rows over, I want to move the rows completly out of the "Main" Sheet to the specified sheet.
Code as follows:
Dim Mfile As String
Dim Dsh As String
Dim Rend As Long
Dim Dd As Long
Dim Nend As Long
Dsh = "Main"
Mfile = ActiveWorkbook.Name
Workbooks(Mfile).Activate
Sheets(Dsh).Select
Rend = Cells(65536, 1).End(xlUp).Row
For Dd = 1 To Rend
Select Case Cells(Dd, 6)
Case "1"
Nend = Sheets("Missing1").Cells(65536, 1).End(xlUp).Row + 1
Rows(Dd).Copy Destination:=Sheets("Missing1").Cells(Nend, 1)
End Select
Next Dd
Sheets("Sheet2").Select
Columns("F:F").Select
Selection.ClearContents
Range("A1").Select
End Sub
Now this part of my code is used to copy the lines:
Select Case Cells(Dd, 6)
Case "1"
Nend = Sheets("Missing1").Cells(65536, 1).End(xlUp).Row + 1
Rows(Dd).Copy Destination:=Sheets("Missing1").Cells(Nend, 1)
But what I want to know is there away to change the "Copy Destination" to a move function?
Hope I have giving enough info.
Cheers
Colin