Excel

Closed
danehen Posts 1 Registration date Wednesday February 4, 2009 Status Member Last seen February 5, 2009 - Feb 5, 2009 at 02:45 PM
 Helper - Feb 5, 2009 at 06:11 PM
Hello,

i need help in solving a macro issue. i have written a macro to delete rows base on a certain criteria. this is, "week 01", the issue is, when the macro was recorded it delete only for 38 specific row in which i want it to delete all week 01 base on updated data. each week the data is updated, thus, the macro will need to not only delete 38 rows but also any amount of rows that has "week 01". thanks for your help in advance.
Related:

1 response

Thiis code assumes that "week 01" is in column A.
Hope this helps.


Private Sub DeleteWeek01()

Dim intRow
Dim intLastRow
intLastRow = Range("A65536").End(xlUp).Row
Dim Del
Del = "week 01"

For intRow = intLastRow To 1 Step -1

Rows(intRow).Select
If Cells(intRow, 1).Value = Del Then
Cells(intRow, 1).Select
Selection.EntireRow.Delete

End If

Next intRow

Range("A1").Select

End Sub
0