The attached file shows where i'm at. What it does is sort the 'Data' sheet onto named sheets according to the number within the data in column 4. I have working code but with over 7k lines in the 'Data' sheet the operation is a little slow. Can anyone suggest some changes to help? I have heard that cut n paste is the slow way of doing things!
Any suggestions on how I can combine another function so that when the 'Move Stuff' routine is called, it checks for duplicate data in the target sheet and deletes it?
Here is the main code:
Also there are no error traps should something dodgy be encountered, ie Destination sheet doesn't exist.![]()
Sub MoveData() Application.ScreenUpdating = False Dim PointNo As String Dim LastRow As Long Dim Text As String LastRow = [A65536].End(xlUp).Row For I = 2 To LastRow Step 1 Sheets("Data").Select 'Select the DATA tab Text = Cells(I, 4) 'Text = value of cell i:4 PointNo = Mid(Text, 3, 4) 'start at 3 and next 4 chars Rows(I & ":" & I).Copy 'copy entire row Sheets(PointNo).Select Selection.EntireRow.Insert ActiveCell.Offset(1, 0).Select 'select next line on that sheet for next visit Next I Sheets("Data").Select MsgBox "Sort Complete", vbInformation Application.ScreenUpdating = True End Sub
Thanks
Bookmarks