Hi,
I have a macro that exports a row (or rows) to destination sheet ("Amber") based on criteria in Column K. Once exported I return to the source sheet ("Register") and the row that had the data that I wanted exported has exported the info but the row just sits where it was and appears to only 'clear the contents'. The macro I use is:
Sub Extract_FW_Rows()
Set ws = ActiveSheet
endrow = ws.Cells(65000, 1).End(xlUp).Row
For i = endrow To 1 Step -1
If ws.Cells(i, 9).Value = "Found Work" Then
exportrow = Sheets("Amber").Cells(65000, 1).End(xlUp).Row + 1
Sheets("Amber").Rows(exportrow).Value = ws.Rows(i).Value
ws.Rows(i).Delete
End If
Next
Worksheets("Register").Select
Worksheets("Register").Activate
Range("A3").Select
End Sub
I set up the macro on Excel 2002 in work as thats what we have....however when I input the same code into my home laptop working Excel 2007, all works perfectly i.e. it cuts the data to destination sheet, goes back to source sheet and the rows have moved up accordingly - I do realise that the action taken is a row removal i.e. I had 1000 rows, macro executes, I now have 999 rows in the source sheet.
What I would like is the same result in 2002 as I get in 2007.
Can anyone help?
Craigos
I have a macro that exports a row (or rows) to destination sheet ("Amber") based on criteria in Column K. Once exported I return to the source sheet ("Register") and the row that had the data that I wanted exported has exported the info but the row just sits where it was and appears to only 'clear the contents'. The macro I use is:
Sub Extract_FW_Rows()
Set ws = ActiveSheet
endrow = ws.Cells(65000, 1).End(xlUp).Row
For i = endrow To 1 Step -1
If ws.Cells(i, 9).Value = "Found Work" Then
exportrow = Sheets("Amber").Cells(65000, 1).End(xlUp).Row + 1
Sheets("Amber").Rows(exportrow).Value = ws.Rows(i).Value
ws.Rows(i).Delete
End If
Next
Worksheets("Register").Select
Worksheets("Register").Activate
Range("A3").Select
End Sub
I set up the macro on Excel 2002 in work as thats what we have....however when I input the same code into my home laptop working Excel 2007, all works perfectly i.e. it cuts the data to destination sheet, goes back to source sheet and the rows have moved up accordingly - I do realise that the action taken is a row removal i.e. I had 1000 rows, macro executes, I now have 999 rows in the source sheet.
What I would like is the same result in 2002 as I get in 2007.
Can anyone help?
Craigos