assuming you mean the macro in the text file (although it should the same as with others), you should only need to change the sheet name to make it work with a csv. At most, you'll need to save the csv as an excel workbook.
This is what you need to change:
change the sheet name to match your sheet name: Sheets("
Sheet1").Select
change the data file to the name that shows in the navigation pane (in 2007 it might be the name, not email address): FolderPath = "
alias@domain.com\Contacts"
delete this line:
Set groupFolder = cFolder.Folders(strGroup)
and change the next line to this:
Set myContacts =
cFolder.items
during testing, add a ' to the error check so its easier to find errors:
' On Error Resume Next
This will need to be changed too as the original sheet had a value in columns 2 and 5 letting the user know if the address was bad or changed and which folder it was in:
Do Until Trim(Cells(i, 1).Value) = ""
strGroup = Cells(i, 5).Value
Debug.Print strGroup
strGroup = Replace(strGroup, " Grp", "")
Debug.Print strGroup
Assuming column 1 (A) has the address, i think this will work to replace the end of the macro - replace from do until... to the end with this:
Do Until Trim(Cells(i, 1).Value) = ""
strAddress = Cells(i, 1)
Set myItem = myContacts.Find("[Email1Address]=" & strAddress)
If TypeName(myItem) = "ContactItem" Then
If Not TypeName(myItem) = "Nothing" Then
myItem.categories = "Delete"
myItem.Save
End If
End If
i = i + 1
Loop
Set olApp = Nothing
End Sub
make all of the editing in a text file - then open the vba editor in excel (alt+f11) and paste it into the thisworkbook module and run it. CSV files can't store macros so you'll need to paste it in each time you need to do this - if this was just a one-off deal, there is no point in saving it in a workbook - but save the text file in case you need it again.
if you haven't used vba before, you'll need to change macro security to low to use it - excel's file, option, trust center, macro security.