Create a userform with a LisBox and a CommandButton in it.
Private Sub UserForm_Initialize()
With Sheet1
wCol = Application.Match("Program name", .Rows(1), 0)
ListBox1.List = Application.Unique(.Columns(wCol))
End With
End Sub
Private Sub CommandButton1_Click()
Sheet2.Cells(1, 11).CurrentRegion.Offset(1).ClearContents
With ListBox1
For i = 1 To .ListCount - 1
If .Selected(i) Then Sheet2.Range("K" & Rows.Count).End(xlUp).Offset(1) = .List(i, 0)
Next
End With
With Sheet1
.Cells(1).CurrentRegion.AdvancedFilter 2, Sheet2.Cells(1, 11).CurrentRegion, Sheet2.Cells(1).Resize(, 8)
End With
With Sheet2
wColTo = .Cells(2, Application.Match("Project Owner Email", .Rows(1), 0))
wColCC = .Cells(2, Application.Match("PM Email", .Rows(1), 0))
.Columns.AutoFit
.Cells(1).CurrentRegion.Copy
End With
With CreateObject("outlook.application").CreateItem(0)
.to = wColTo
.cc = wColCC
.Subject = "Hello Project Owner, please find the below table and work on it"
With .GetInspector
.Display
.WordEditor.Range(0, 0).Paste
End With
End With
Application.CutCopyMode = False
End Sub
Bookmarks