ChrisKad
07-02-2015, 01:42 AM
Hi,
I'm trying to filter, copy filtered data to a new sheet, and delete the filtered data from the original sheet. I have no idea how to do that.
All I know to do is add filters to columns using the code:
Sub TurnAutoFilterOn()
If Not ActiveSheet.AutoFilterMode Then
ActiveSheet.Range("A1:M1").AutoFilter
End If
End Sub
I attached a file so you can see what I'm trying to do.
I want to filter first of all column "M". Each time I see MHO (which is part of the data in column M), I want the code to copy that name (and whole row), paste it on another sheet and delete the lines it was on from the original sheet. MHO could appear in different lines so I need the code to be able to find this name anywhere in the column and copy it and delete it after from the original sheet.
Secondly, I would like to filter column B (mois) which is "months". I'm supposed to split the information in 3 different sheets, hence; 06=June, 07=July, 08=August. So after the code has filtered 06 for example, I would like it to copy and paste on a new sheet and then delete the data from the original sheet and then obviously the same thing for the subsequent months. This is a task I have to do on a weekly basis and I tried using a macro but it's not advanced enough to do specific functions like this advanced filter.
Your help will be much appreciated. Thank you
PS. I am usin excel 2010
I'm trying to filter, copy filtered data to a new sheet, and delete the filtered data from the original sheet. I have no idea how to do that.
All I know to do is add filters to columns using the code:
Sub TurnAutoFilterOn()
If Not ActiveSheet.AutoFilterMode Then
ActiveSheet.Range("A1:M1").AutoFilter
End If
End Sub
I attached a file so you can see what I'm trying to do.
I want to filter first of all column "M". Each time I see MHO (which is part of the data in column M), I want the code to copy that name (and whole row), paste it on another sheet and delete the lines it was on from the original sheet. MHO could appear in different lines so I need the code to be able to find this name anywhere in the column and copy it and delete it after from the original sheet.
Secondly, I would like to filter column B (mois) which is "months". I'm supposed to split the information in 3 different sheets, hence; 06=June, 07=July, 08=August. So after the code has filtered 06 for example, I would like it to copy and paste on a new sheet and then delete the data from the original sheet and then obviously the same thing for the subsequent months. This is a task I have to do on a weekly basis and I tried using a macro but it's not advanced enough to do specific functions like this advanced filter.
Your help will be much appreciated. Thank you
PS. I am usin excel 2010