Filter through unknown items and paste items to Outlook

shanwick

New Member
Joined
Jul 8, 2018
Messages
1
Hello!

Here's what I'm trying to do, I have a table like this:


PartDescRemPlatPriceEmail
TK800TestTestA9856a@bot.com
BK890TestTestB6557z@bot.com
KO983TestTestH478a@bot.com

<tbody>
</tbody>


There will be many, many lines, and many email addresses. In this example, I just need a way to automatically filter both "a@bot.com" email addresses, and then copy cells 1 to 3 (Part, Desc and Rem), and paste it into an outlook email. I know how to do the latter bit, just need to figure out how to filter emails. The thing is, it's not a set list of emails, it will have new ones every time so I can't cycle through it.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Hi & welcome to MrExcel
how about
Code:
Sub Filteremail()
   Dim Cl As Range
   Dim Dic As Object
   
   Set Dic = CreateObject("scripting.dictionary")
   Dic.CompareMode = vbTextCompare
   With Sheet3
      If .AutoFilterMode Then .AutoFilterMode = False
      For Each Cl In .Range("F2", .Range("F" & Rows.Count).End(xlUp))
         If Not Dic.exists(Cl.Value) Then
            Dic.Add Cl.Value, Nothing
            .Range("A1:F1").autofilter 6, Cl.Value
            Intersect(.autofilter.Range, Range("A:C")).Copy Sheet9.Range("A1")
            'do something
         End If
      Next Cl
      .AutoFilterMode = False
   End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,236
Members
448,555
Latest member
RobertJones1986

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top