|I do know that, but I'm new to VB.|
Basically I'm trying to delete any rows that did not have a project team returned into ColumnA as a result of the VLOOKUP function.
Here's the one I tried using from online and tweaking it; my issue is that I use vlookup to get the project team into sheet1 (column A)based on a table with the individual's name & project team from sheet2.
In using the sample below, it expects actual data and not formulas in the cell to determine the criteria to delete.
Dim strToDelete As String
Dim rngSrc As Range
Dim NumRows As Integer
Dim ThisRow As Integer
Dim ThatRow As Integer
Dim ThisCol As Integer
Dim J As Integer
Dim DeletedRows As Integer
strToDelete = InputBox("Value to Trigger Delete?", "Delete Rows")
Set rngSrc = ActiveSheet.Range(ActiveWindow.Selection.Address)
NumRows = rngSrc.Rows.Count
ThisRow = rngSrc.Row
ThatRow = ThisRow + NumRows - 1
ThisCol = rngSrc.Column
For J = ThatRow To ThisRow Step -1
If Cells(J, ThisCol) = strToDelete Then
DeletedRows = DeletedRows + 1
MsgBox "Number of deleted rows: " & DeletedRows
Any suggestions? Or could you point me in the right direction? (I'd like to understand so I can learn from this - I'm new to coding...)