-
Welcome to vbax
Assuming the 4 names are in a block below and separated from the full list
[VBA]
Option Explicit
Sub GetData()
Dim c As Range, Nms As Range
Dim emp As Range
Dim e As Range
Set c = Columns(1).Find("Employee name")
Set Nms = Range(c(2), c(2).End(xlDown))
Set emp = c.End(xlDown).End(xlDown)
Set emp = Range(emp, emp.End(xlDown))
For Each e In emp
Nms.Find(e, lookat:=xlWhole).EntireRow.Cut e
Next
Nms.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules