Hi,
I have used a Macro that looks at the values in a certain column and deletes the row if it meets the specified criteria, in this instance it is any grade that is an F or higher, code below.
Sub Del_Seniors()
Range("P5").Select
Do Until ActiveCell.Value = ""
If ActiveCell.Value > "F" Then
ActiveCell.EntireRow.Delete
Else
ActiveCell.Offset(1, 0).Select
End If
Loop
End Sub
The macro works which is great. However, the workbook I am working on has multiple worksheets which also need to be checked using the same rules but the column order varies. For example, in Sheet1 the data is in column 16, in Sheet2 the data is in column 10....each column has the same heading.
Is there a way of identifying which column holds the relevant data, select it and then run the above VBA?
Any help would be greatly appreciated.
Bookmarks